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;
|
||||
}
|
||||
|
||||
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 New Issue
Block a user