fix: crash when generating shortcut text for super accelerator (#44346)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-10-22 19:21:40 +02:00 committed by GitHub
commit 633cec167e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 1 deletions

View file

@ -926,6 +926,20 @@ describe('Menu module', function () {
});
w.show();
});
it('does not crash when rendering menu item with Super or meta accelerator', async () => {
const menu = Menu.buildFromTemplate([{
label: 'Test Super',
accelerator: 'Super+Ctrl+T'
}, {
label: 'Test Meta',
accelerator: 'Meta+Ctrl+T'
}]);
const menuWillClose = once(menu, 'menu-will-close');
menu.popup({ window: w });
menu.closePopup();
await menuWillClose;
});
});
describe('Menu.setApplicationMenu', () => {