Browse Source

fix(admin-ui): Fix error creating product with localeString custom prop

Michael Bromley 6 years ago
parent
commit
4ae5b72cee

+ 3 - 1
admin-ui/src/app/catalog/components/product-detail/product-detail.component.ts

@@ -404,7 +404,9 @@ export class ProductDetailComponent extends BaseDetailComponent<ProductWithVaria
                 const key = fieldDef.name;
                 const value =
                     fieldDef.type === 'localeString'
-                        ? (currentTranslation as any).customFields[key]
+                        ? currentTranslation
+                            ? (currentTranslation as any).customFields[key]
+                            : null
                         : (product as any).customFields[key];
                 const control = customFieldsGroup.get(key);
                 if (control) {