Bug 1881820 - Handle SidebarUI not being initialized in updateShortcut. r=rpl

Differential Revision: https://phabricator.services.mozilla.com/D205440
This commit is contained in:
Dão Gottwald 2024-03-27 11:23:57 +00:00
parent fa765267d1
commit 3713c5dd3b

View File

@ -311,7 +311,7 @@ var SidebarUI = {
},
updateShortcut({ keyId }) {
let menuitem = this._switcherPanel.querySelector(`[key="${keyId}"]`);
let menuitem = this._switcherPanel?.querySelector(`[key="${keyId}"]`);
if (!menuitem) {
// If the menu item doesn't exist yet then the accel text will be set correctly
// upon creation so there's nothing to do now.