Skip to content

Commit

Permalink
Check if menu.extras exists before using
Browse files Browse the repository at this point in the history
  • Loading branch information
APochmann authored Mar 27, 2024
1 parent d85c660 commit 9679e88
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions public/js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -56,4 +57,4 @@ pimcore.bundle.fileexplorer.startup = Class.create({
},
})

const fileexplorer = new pimcore.bundle.fileexplorer.startup();
const fileexplorer = new pimcore.bundle.fileexplorer.startup();

0 comments on commit 9679e88

Please sign in to comment.