From 2af25e45f5efdee33d96268d6700ec7d2c3db061 Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Fri, 14 May 2021 22:03:48 +0200 Subject: Fix more bugs --- settings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/settings.js b/settings.js index 51b743d..db0cd4c 100644 --- a/settings.js +++ b/settings.js @@ -7,7 +7,7 @@ function set_settings() change_theme(); remove_titles(); remove_text(); - set_mod_message(); + set_mod_message(null); } /* Initialize the settings page by flipping the switches and such */ @@ -84,10 +84,11 @@ function remove_text() /* Set a custom mod message */ function set_mod_message(event) { - if (event.target.value.replace(/\s/g, "")) + if (event && event.target.value.replace(/\s/g, "")) localStorage.setItem("custom_mod_message", event.target.value); else { - event.target.value = mod_message_default; + if (event) + event.target.value = mod_message_default; localStorage.setItem("custom_mod_message", mod_message_default); } } -- cgit v1.2.3