From 3cb876460396983cff1534fbc2ef9a07acc24b7b Mon Sep 17 00:00:00 2001 From: Snipzil Date: Wed, 21 Oct 2026 20:34:59 -0400 Subject: [PATCH] fix(app): handle captcha URL load failures Add error handling to the captcha URL loading process to prevent unhandled promise rejections. If the URL fails to load, the captcha answer is cleared and the window is closed if it hasn't been destroyed. --- app/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/main.js b/app/main.js index 5c89737..bd81329 100644 --- a/app/main.js +++ b/app/main.js @@ -353,7 +353,12 @@ ipcMain.handle("captcha", (event, serverUrl, action) => new Promise(resolve => { captchaServer = null; answer(""); }); - box.loadURL(new URL(`/captcha?action=${action === "signup" ? "signup" : "login"}`, server).href); + box.loadURL(new URL(`/captcha?action=${action === "signup" ? "signup" : "login"}`, server).href).catch(() => { + answer(""); + if (!box.isDestroyed()) { + box.close(); + } + }); })); // what the client's processes use: the game is the "Pepper Plugin" one.