From 27de108579afad59d97353d40d932fdc1e07c7c0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Dec 2025 15:58:13 +0000 Subject: [PATCH] Add error handling to SIGUSR1 power button handler --- install_kiosk_v0.9.9.1.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/install_kiosk_v0.9.9.1.sh b/install_kiosk_v0.9.9.1.sh index 98875dd..1933455 100644 --- a/install_kiosk_v0.9.9.1.sh +++ b/install_kiosk_v0.9.9.1.sh @@ -5531,8 +5531,16 @@ if(!app.requestSingleInstanceLock())app.quit(); // Handle SIGUSR1 from power button trigger script process.on('SIGUSR1',()=>{ - console.log('[POWER] Received SIGUSR1 signal - showing power menu'); - showPowerMenu(); + console.log('[POWER] Received SIGUSR1 signal'); + try{ + if(mainWindow&&!mainWindow.isDestroyed()){ + showPowerMenu(); + }else{ + console.log('[POWER] mainWindow not ready'); + } + }catch(e){ + console.error('[POWER] Error:',e.message); + } }); app.on('certificate-error',(e,w,u,er,c,cb)=>{