From de0e341b4bc7739036c870a101ef5fea1a7673f6 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Thu, 4 Aug 2011 19:22:46 +0100 Subject: [PATCH] fixed ok response --- node/handler/APIHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/handler/APIHandler.js b/node/handler/APIHandler.js index 6afe11733..383930c7c 100644 --- a/node/handler/APIHandler.js +++ b/node/handler/APIHandler.js @@ -108,7 +108,10 @@ exports.handle = function(functionName, fields, req, res) // no error happend, everything is fine if(err == null) { - res.send({code: 0, message: null, data: data}); + if(!data) + data = null; + + res.send({code: 0, message: "ok", data: data}); } // parameters were wrong and the api stopped execution, pass the error else if(err.stop)