Browse Source

fix(admin-ui): Fix error if no array of assets is provided (#1249)

Steffen Wilking 4 years ago
parent
commit
5af2b12c50

+ 1 - 1
packages/admin-ui/src/lib/catalog/src/components/product-assets/product-assets.component.ts

@@ -42,7 +42,7 @@ export interface AssetChange {
 export class ProductAssetsComponent {
     @Input('assets') set assetsSetter(val: Asset[]) {
         // create a new non-readonly array of assets
-        this.assets = val.slice();
+        this.assets = (val || []).slice();
     }
 
     @Input() featuredAsset: Asset | undefined;