Apply 1 suggestion(s) to 1 file(s)
authorLaurent Mazet <laurent.mazet@softndesign.org>
Sun, 13 Sep 2020 10:00:32 +0000 (10:00 +0000)
committerLaurent Mazet <laurent.mazet@softndesign.org>
Sun, 13 Sep 2020 10:00:32 +0000 (10:00 +0000)
public/trivabble.js

index 5286b7ffc47e7896d92d49ba47aedbd637082c95..1f65fa768810b887597351efaca45917742e6890 100644 (file)
@@ -34,6 +34,9 @@
     function setConf(parameterName, defaultValue) {
         if (typeof Conf[parameterName] === "undefined") {
             Conf[parameterName] = defaultValue;
+        } else if (typeof Conf[parameterName] !== typeof defaultValue) {
+            alert("Head's up - configuration " + parameterName + " does not have the right type. It should be a " + (typeof defaultValue) + ", it is a " + (typeof Conf[parameterName]));
+            throw new Error("Wrong type for configuration " + parameterName + ", expected " + (typeof defaultValue) + ", got " + (typeof Conf[parameterName]));  
         }
     }