Browse files

Merge pull request #57 from dhm116/master

Empty server response causes "Unexpected end of input" exception
  • Loading branch information...
2 parents fbc63c8 + 586b9f4 commit 39d1daecd029b6a34d79b8fb92dd6e3aa08cd512 @ayoung ayoung committed Jan 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/restler.js
View
2 lib/restler.js
@@ -235,7 +235,7 @@ var parsers = {
callback(data);
},
json: function(data, callback) {
- callback(data && JSON.parse(data));
+ callback(data && data.length > 1 && JSON.parse(data));
}
};

0 comments on commit 39d1dae

Please sign in to comment.