mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01: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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
global.mainWindow.webContents.send("ipcReply", {
|
global.mainWindow?.webContents.send("ipcReply", {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
reply: ret,
|
reply: ret,
|
||||||
});
|
});
|
||||||
|
@ -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,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user