Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

Commit

Permalink
Ignore empty responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristandunn committed Oct 18, 2011
1 parent 4bb3ce8 commit a014624
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/campfire.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ Campfire.prototype.request = function(method, path, body, callback) {
data += chunk;
});
response.on("end", function() {
if (!data.trim()) {
return;
}

try {
data = JSON.parse(data);
} catch(e) {
Expand Down

0 comments on commit a014624

Please sign in to comment.