Skip to content

Commit 47b5954

Browse files
committed
fix: tray menu support gives command an exception in headless mode
seems innocuous, but alarming
1 parent 9b170a1 commit 47b5954

File tree

1 file changed

+12
-10
lines changed
  • plugins/plugin-codeflare/src

1 file changed

+12
-10
lines changed

plugins/plugin-codeflare/src/tray.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,16 @@ export async function main(/* createWindow: (argv: string[]) => void */) {
8585
}
8686

8787
export async function renderer(ipcRenderer: import("electron").IpcRenderer) {
88-
ipcRenderer.send(
89-
"/exec/invoke",
90-
JSON.stringify({
91-
module: "plugin-codeflare",
92-
main: "initTray",
93-
args: {
94-
command: "/tray/init",
95-
},
96-
})
97-
)
88+
if (ipcRenderer) {
89+
ipcRenderer.send(
90+
"/exec/invoke",
91+
JSON.stringify({
92+
module: "plugin-codeflare",
93+
main: "initTray",
94+
args: {
95+
command: "/tray/init",
96+
},
97+
})
98+
)
99+
}
98100
}

0 commit comments

Comments
 (0)