Skip to content
Snippets Groups Projects
Commit 1919c986 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Throw a different exception if get_mod_options() is passed a non-string modname

parent 0e9f377b
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
"use strict"; "use strict";
function get_mod_options(modname, optname, default_optval) function get_mod_options(modname, optname, default_optval)
{ {
if(typeof modname !== "string")
throw new Error("Module name specified is wrong type: " + typeof modname);
if(!modname) if(!modname)
throw new Error("No module name specified"); throw new Error("No module name specified");
var ini_file = new File(system.ctrl_dir + "modopts/" + modname.replace(":", "-") + ".ini"); var ini_file = new File(system.ctrl_dir + "modopts/" + modname.replace(":", "-") + ".ini");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment