From 8481c294fe7444f546e55679bdf8b65a36d4bea8 Mon Sep 17 00:00:00 2001 From: Vladimir Malik Date: Sat, 14 Sep 2024 14:59:41 +0200 Subject: [PATCH] Checking if children is defined: for case if all custom views've been removed. --- src/Resources/public/js/pimcore/perspective/view.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Resources/public/js/pimcore/perspective/view.js b/src/Resources/public/js/pimcore/perspective/view.js index 53f412a..e13a133 100644 --- a/src/Resources/public/js/pimcore/perspective/view.js +++ b/src/Resources/public/js/pimcore/perspective/view.js @@ -121,9 +121,11 @@ pimcore.bundle.perspectiveeditor.ViewEditor = class { disabled: !pimcore.settings['custom-views-writeable'], handler: function(){ const serializedViews = this.viewTreeStore.getRoot().serialize(); - for (let child of serializedViews.children) { - if (child.config.classes && Array.isArray(child.config.classes)) { - child.config.classes = child.config.classes.join(','); + if (serializedViews.children !== undefined) { + for (let child of serializedViews.children) { + if (child.config.classes && Array.isArray(child.config.classes)) { + child.config.classes = child.config.classes.join(','); + } } } Ext.Ajax.request({