add safety check to ensure electron window is not destroyed

This commit is contained in:
contributor 2025-11-07 20:20:03 +02:00
parent 44b34d1ea0
commit a29597a4bf

View File

@ -338,7 +338,7 @@ async function registerGlobalShortcuts() {
translatedShortcut,
cls.wrap(() => {
const targetWindow = getLastFocusedWindow() || mainWindow;
if (!targetWindow) {
if (!targetWindow || targetWindow.isDestroyed()) {
return;
}