From 94a76b3f5ce26f9d200920978d4861d199bc5497 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Sun, 13 Sep 2020 10:00:32 +0000 Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s) --- public/trivabble.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/trivabble.js b/public/trivabble.js index 5286b7f..1f65fa7 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -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])); } } -- 2.30.2