From 1608e54e01b6741243eba8403d43d38b0b03461f Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Fri, 31 Jan 2025 12:52:49 -0500 Subject: [PATCH] Fix crash caused by `electron-context-menu` (#3310) --- patches/electron-context-menu+4.0.4.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/electron-context-menu+4.0.4.patch b/patches/electron-context-menu+4.0.4.patch index 459778be..8b5534c1 100644 --- a/patches/electron-context-menu+4.0.4.patch +++ b/patches/electron-context-menu+4.0.4.patch @@ -47,7 +47,7 @@ index 468e48b..e182878 100644 event: ElectronEvent ) => MenuItemConstructorOptions[]; diff --git a/node_modules/electron-context-menu/index.js b/node_modules/electron-context-menu/index.js -index b10daea..ea2f891 100644 +index b10daea..d7d26f3 100644 --- a/node_modules/electron-context-menu/index.js +++ b/node_modules/electron-context-menu/index.js @@ -1,7 +1,6 @@ @@ -103,3 +103,12 @@ index b10daea..ea2f891 100644 }, }), copyImage: decorateMenuItem({ +@@ -350,7 +349,7 @@ const create = (win, options) => { + webContents(win).on('context-menu', handleContextMenu); + + return () => { +- if (win.isDestroyed()) { ++ if (webContents(win).isDestroyed()) { + return; + } +