diff options
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js index b019022..e14fcb1 100644 --- a/lib/util.js +++ b/lib/util.js @@ -30,7 +30,7 @@ var urlMod = require("url"); */ exports.heir = function heir(p) { function f() {}; - f.prototype = p.prototype; + f.prototype = p.prototype; return new f(); }; @@ -38,6 +38,9 @@ exports.heir = function heir(p) { var getBugNo = exports.getBugNo = function getBugNo(url) { var re = new RegExp(".*id=([0-9]+).*$"); var bugNo = null; + if (!url) { + throw new Error("Missing URL value!"); + } var reResult = re.exec(url); if (reResult[1]) { bugNo = reResult[1]; |