mirror of
https://github.com/bitwarden/desktop.git
synced 2024-11-24 11:55:50 +01: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,
|
appVersion: string,
|
||||||
updateRequest?: MenuUpdateRequest
|
updateRequest?: MenuUpdateRequest
|
||||||
) {
|
) {
|
||||||
|
let isLocked = true;
|
||||||
|
if (
|
||||||
|
updateRequest != null &&
|
||||||
|
updateRequest.accounts != null &&
|
||||||
|
updateRequest.activeUserId != null
|
||||||
|
) {
|
||||||
|
isLocked = updateRequest.accounts[updateRequest.activeUserId]?.isLocked ?? true;
|
||||||
|
}
|
||||||
|
|
||||||
this.items = [
|
this.items = [
|
||||||
new BitwardenMenu(
|
new BitwardenMenu(
|
||||||
i18nService,
|
i18nService,
|
||||||
@ -60,28 +69,10 @@ export class Menubar {
|
|||||||
windowMain.win,
|
windowMain.win,
|
||||||
updateRequest?.accounts
|
updateRequest?.accounts
|
||||||
),
|
),
|
||||||
new FileMenu(
|
new FileMenu(i18nService, messagingService, isLocked),
|
||||||
i18nService,
|
new EditMenu(i18nService, messagingService, isLocked),
|
||||||
messagingService,
|
new ViewMenu(i18nService, messagingService, isLocked),
|
||||||
updateRequest?.accounts[updateRequest?.activeUserId]?.isLocked ?? true
|
new AccountMenu(i18nService, messagingService, webVaultUrl, windowMain.win, isLocked),
|
||||||
),
|
|
||||||
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 WindowMenu(i18nService, messagingService, windowMain),
|
new WindowMenu(i18nService, messagingService, windowMain),
|
||||||
new AboutMenu(i18nService, appVersion, windowMain.win, updaterMain),
|
new AboutMenu(i18nService, appVersion, windowMain.win, updaterMain),
|
||||||
new HelpMenu(i18nService, webVaultUrl),
|
new HelpMenu(i18nService, webVaultUrl),
|
||||||
|
Loading…
Reference in New Issue
Block a user