mirror of
https://github.com/vector-im/element-desktop.git
synced 2024-07-06 22:43:28 +00:00
Null guard global mainWindow better (#948)
This commit is contained in:
parent
0b01b94316
commit
f928d59208
|
@ -253,7 +253,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
|
|||
return;
|
||||
}
|
||||
|
||||
global.mainWindow.webContents.send("ipcReply", {
|
||||
global.mainWindow?.webContents.send("ipcReply", {
|
||||
id: payload.id,
|
||||
reply: ret,
|
||||
});
|
||||
|
|
|
@ -304,14 +304,14 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
|
|||
break;
|
||||
|
||||
default:
|
||||
global.mainWindow.webContents.send("seshatReply", {
|
||||
global.mainWindow?.webContents.send("seshatReply", {
|
||||
id: payload.id,
|
||||
error: "Unknown IPC Call: " + payload.name,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
global.mainWindow.webContents.send("seshatReply", {
|
||||
global.mainWindow?.webContents.send("seshatReply", {
|
||||
id: payload.id,
|
||||
reply: ret,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue