瀏覽代碼

Fix err detection

jmacura 5 年之前
父節點
當前提交
b3d94666c2
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      index.js

+ 4 - 2
index.js

@@ -132,8 +132,10 @@ app.get('/runR', (req, res, next) => {
         function(err, data) {
             console.log('R done');
             if (err) console.log(err.toString('utf8'))
-            else console.log(data);
-            if (!data) data = {result: 'R call succesful'}
+            else {
+							console.log(data);
+              data = {result: 'R call succesful'};
+						}
             helpers.formatResponse({ response: data }, req, res);
         }
     );