Null guard global mainWindow better (#948)
This commit is contained in:
+1
-1
@@ -253,7 +253,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global.mainWindow.webContents.send("ipcReply", {
|
global.mainWindow?.webContents.send("ipcReply", {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
reply: ret,
|
reply: ret,
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-2
@@ -304,14 +304,14 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
global.mainWindow.webContents.send("seshatReply", {
|
global.mainWindow?.webContents.send("seshatReply", {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
error: "Unknown IPC Call: " + payload.name,
|
error: "Unknown IPC Call: " + payload.name,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global.mainWindow.webContents.send("seshatReply", {
|
global.mainWindow?.webContents.send("seshatReply", {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
reply: ret,
|
reply: ret,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user