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)