Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
Only send a payload if one is absolutely needed. Thanks @KoalaBear84
  • Loading branch information
Alex Schneider committed Oct 25, 2014
1 parent 45c5c23 commit 71f3125
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pushbullet.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ var PushBullet = (function() {
ajax.setRequestHeader("Content-Type", "application/json");
parameters = JSON.stringify(parameters);
}
ajax.send(parameters);
if(parameters) {
ajax.send(parameters);
} else {
ajax.send();
}

if(!async) {
return handleResponse(ajax);
}
Expand Down

0 comments on commit 71f3125

Please sign in to comment.