mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-05 00:41:15 +02:00
Fix null ref when building/updating the MenuBar (#1227)
This commit is contained in:
parent
f6f0bd2bfb
commit
2b64ec5375
@ -52,6 +52,15 @@ export class Menubar {
|
||||
appVersion: string,
|
||||
updateRequest?: MenuUpdateRequest
|
||||
) {
|
||||
let isLocked = true;
|
||||
if (
|
||||
updateRequest != null &&
|
||||
updateRequest.accounts != null &&
|
||||
updateRequest.activeUserId != null
|
||||
) {
|
||||
isLocked = updateRequest.accounts[updateRequest.activeUserId]?.isLocked ?? true;
|
||||
}
|
||||
|
||||
this.items = [
|
||||
new BitwardenMenu(
|
||||
i18nService,
|
||||
@ -60,28 +69,10 @@ export class Menubar {
|
||||
windowMain.win,
|
||||
updateRequest?.accounts
|
||||
),
|
||||
new FileMenu(
|
||||
i18nService,
|
||||
messagingService,
|
||||
updateRequest?.accounts[updateRequest?.activeUserId]?.isLocked ?? true
|
||||
),
|
||||
new EditMenu(
|
||||
i18nService,
|
||||
messagingService,
|
||||
updateRequest?.accounts[updateRequest?.activeUserId]?.isLocked ?? true
|
||||
),
|
||||
new ViewMenu(
|
||||
i18nService,
|
||||
messagingService,
|
||||
updateRequest?.accounts[updateRequest?.activeUserId]?.isLocked ?? true
|
||||
),
|
||||
new AccountMenu(
|
||||
i18nService,
|
||||
messagingService,
|
||||
webVaultUrl,
|
||||
windowMain.win,
|
||||
updateRequest?.accounts[updateRequest?.activeUserId]?.isLocked ?? true
|
||||
),
|
||||
new FileMenu(i18nService, messagingService, isLocked),
|
||||
new EditMenu(i18nService, messagingService, isLocked),
|
||||
new ViewMenu(i18nService, messagingService, isLocked),
|
||||
new AccountMenu(i18nService, messagingService, webVaultUrl, windowMain.win, isLocked),
|
||||
new WindowMenu(i18nService, messagingService, windowMain),
|
||||
new AboutMenu(i18nService, appVersion, windowMain.win, updaterMain),
|
||||
new HelpMenu(i18nService, webVaultUrl),
|
||||
|
Loading…
Reference in New Issue
Block a user