From 8915ed6b738fd605ab15798784c0c688b107855b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 12 Jun 2010 10:14:00 +0200 Subject: Even more simplification --- lib/util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/util.js') 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]; -- cgit