From a7dd620b9f7d567273c766b7c1c056d564b17dc2 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Tue, 10 Jul 2012 00:53:55 -0400 Subject: [PATCH] Don't crash if setText isn't passed any text. issue #861 --- src/node/db/API.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/node/db/API.js b/src/node/db/API.js index 68a57d7d..4a1371ba 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -154,6 +154,13 @@ Example returns: */ exports.setText = function(padID, text, callback) { + //text is required + if(typeof text != "string") + { + callback(new customError("text is no string","apierror")); + return; + } + //get the pad getPadSafe(padID, true, function(err, pad) {