From 7f7551499c98187f1d2e34c6bb6c3e72edbf8e94 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 8 Nov 2013 23:23:00 -0500 Subject: [PATCH] don't try to parse null response. closes #56 --- lib/dbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dbox.js b/lib/dbox.js index d39a258..5b32531 100644 --- a/lib/dbox.js +++ b/lib/dbox.js @@ -87,9 +87,9 @@ exports.app = function(config){ return request(opts, function(e, r, b){ var status = e ? null : r.statusCode - var output = helpers.parseJSON(b) + var output = b ? helpers.parseJSON(b) : null; - if(typeof reset == 'undefined'){ + if(typeof reset == 'undefined' && output){ reset = output.reset }