null checks on contextMenu

This commit is contained in:
Kyle Spearrin 2018-05-29 23:11:28 -04:00
parent b6b96c33ca
commit 689e7a4999
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ export class MessagingMain {
}
private updateTrayMenu(isAuthenticated: boolean, isLocked: boolean) {
if (this.main.trayMain == null || this.main.trayMain.contextMenu == null) {
return;
}
const lockNowTrayMenuItem = this.main.trayMain.contextMenu.getMenuItemById('lockNow');
if (lockNowTrayMenuItem != null) {
lockNowTrayMenuItem.enabled = isAuthenticated && !isLocked;