From 5d41ab3d9f6cfa1b2674693809dd91f8e68213e4 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Mon, 1 May 2023 21:19:43 +0300 Subject: [PATCH 1/2] More reliable error handling --- server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server.js b/server.js index 43e0c2f37..c0df4c220 100644 --- a/server.js +++ b/server.js @@ -2294,6 +2294,7 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op response_generate_openai.send({ error: true, quota_error }); } catch (error) { console.error(error); + return response_generate_openai.send({ error: true }); } }); }); From 74a11eaecc284997860e10fd040b34765fa65657 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Mon, 1 May 2023 21:26:51 +0300 Subject: [PATCH 2/2] Fix deletion of world info file on empty rename --- public/scripts/world-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 3fb0c6b22..61c455cec 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -371,9 +371,9 @@ async function saveWorldInfo(immediately) { async function renameWorldInfo() { const oldName = world_info; - const newName = $("#world_popup_name").val(); + const newName = $("#world_popup_name").val().trim(); - if (oldName === newName) { + if (oldName === newName || !newName) { return; }