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 committed Mar 28, 2024
1 parent 07798f9 commit e7a699c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 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

0 comments on commit e7a699c

Please sign in to comment.