From 96a0c0d0be7e957f5cee81ee89a6722465147b5e Mon Sep 17 00:00:00 2001 From: Petar Dobrev Date: Thu, 19 Apr 2012 14:45:26 +0300 Subject: [PATCH] getPad fails if an invalid padID is passed and only two function arguments --- src/node/db/PadManager.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index 5f08b1b1b..e88014229 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -54,19 +54,19 @@ var padIdTransforms = [ */ exports.getPad = function(id, text, callback) { - //check if this is a valid padId - if(!exports.isValidPadId(id)) - { - callback(new customError(id + " is not a valid padId","apierror")); - return; - } - //make text an optional parameter if(typeof text == "function") { callback = text; text = null; } + + //check if this is a valid padId + if(!exports.isValidPadId(id)) + { + callback(new customError(id + " is not a valid padId","apierror")); + return; + } //check if this is a valid text if(text != null)