From e7a699caa1303a563e9d58d960a7ad77f47dff5f Mon Sep 17 00:00:00 2001 From: APochmann Date: Thu, 28 Mar 2024 13:06:54 +0100 Subject: [PATCH] Check if menu.extras exists before using --- public/js/startup.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/public/js/startup.js b/public/js/startup.js index 16694d3..9526e4d 100644 --- a/public/js/startup.js +++ b/public/js/startup.js @@ -12,15 +12,16 @@ pimcore.bundle.fileexplorer.startup = Class.create({ this.toolbar = pimcore.globalmanager.get('layout_toolbar'); const systemInfoMenuItems = this.getSystemInfoMenu(); - const filteredMenu = menu.extras.items.filter(function (item) { - return item.itemId === 'pimcore_menu_extras_system_info'; - }); - - const systemInfoMenu = filteredMenu.shift(); - systemInfoMenuItems.map(function(item) { - systemInfoMenu.menu.items.push(item); - }); - + if (menu.extras) { + const filteredMenu = menu.extras.items.filter(function (item) { + return item.itemId === 'pimcore_menu_extras_system_info'; + }); + + const systemInfoMenu = filteredMenu.shift(); + systemInfoMenuItems.map(function(item) { + systemInfoMenu.menu.items.push(item); + }); + } }, getSystemInfoMenu: function () {