Skip to content

Commit

Permalink
limit usage of null
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-marechal committed Jan 27, 2022
1 parent 0babfb1 commit 1e8694a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/electron-main/electron-main-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,7 @@ export class ElectronMainApplication {
protected restart(id: number): void {
this.restarting = true;
const browserWindow = BrowserWindow.fromId(id);
// eslint-disable-next-line no-null/no-null
if (browserWindow === null) {
if (!browserWindow) {
throw new Error(`no BrowserWindow with id: ${id}`);
}
browserWindow.on('closed', async () => {
Expand All @@ -655,8 +654,7 @@ export class ElectronMainApplication {

protected async handleReload(event: Electron.IpcMainEvent): Promise<void> {
const browserWindow = BrowserWindow.fromId(event.sender.id);
// eslint-disable-next-line no-null/no-null
if (browserWindow === null) {
if (!browserWindow) {
throw new Error(`no BrowserWindow with id: ${event.sender.id}`);
}
this.reload(browserWindow);
Expand Down

0 comments on commit 1e8694a

Please sign in to comment.