mirror of
https://github.com/bitwarden/browser
synced 2025-12-30 15:13:32 +00:00
null check windowMain.win
This commit is contained in:
@@ -67,6 +67,10 @@ export class MenuMain {
|
||||
}
|
||||
|
||||
private initContextMenu() {
|
||||
if (this.main.windowMain.win == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectionMenu = Menu.buildFromTemplate([
|
||||
{ role: 'copy' },
|
||||
{ type: 'separator' },
|
||||
|
||||
@@ -62,6 +62,10 @@ export class MessagingMain {
|
||||
}
|
||||
|
||||
this.syncTimeout = global.setTimeout(() => {
|
||||
if (this.main.windowMain.win == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.main.windowMain.win.webContents.send('messagingService', {
|
||||
command: 'checkSyncVault',
|
||||
});
|
||||
|
||||
@@ -28,6 +28,11 @@ export class UpdaterMain {
|
||||
|
||||
autoUpdater.on('update-available', () => {
|
||||
if (this.doingUpdateCheckWithFeedback) {
|
||||
if (this.main.windowMain.win == null) {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
const result = dialog.showMessageBox(this.main.windowMain.win, {
|
||||
type: 'info',
|
||||
title: this.main.i18nService.t('updateAvailable'),
|
||||
@@ -48,7 +53,7 @@ export class UpdaterMain {
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
if (this.doingUpdateCheckWithFeedback) {
|
||||
if (this.doingUpdateCheckWithFeedback && this.main.windowMain.win != null) {
|
||||
dialog.showMessageBox(this.main.windowMain.win, {
|
||||
message: this.main.i18nService.t('noUpdatesAvailable'),
|
||||
});
|
||||
@@ -60,6 +65,10 @@ export class UpdaterMain {
|
||||
autoUpdater.on('update-downloaded', (info) => {
|
||||
this.main.menuMain.updateMenuItem.label = this.main.i18nService.t('restartToUpdate');
|
||||
|
||||
if (this.main.windowMain.win == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = dialog.showMessageBox(this.main.windowMain.win, {
|
||||
type: 'info',
|
||||
title: this.main.i18nService.t('restartToUpdate'),
|
||||
|
||||
Reference in New Issue
Block a user