Skip to content

Commit

Permalink
handle missing message in media/message/json
Browse files Browse the repository at this point in the history
  • Loading branch information
neonstalwart committed Jan 22, 2015
1 parent fc5ee8f commit 36a516b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions media/message/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ module.exports = Media({
var responses = [];
var clientConnection = getClientConnection(request);
body.forEach(function(message){
if (!message) {
return {
status: clientConnection.expectMore ? 202 : 200,
headers: {},
messages: true,
body: []
};
}

message.__proto__ = request;
if(!("to" in message)){
message.to = "";
Expand Down

0 comments on commit 36a516b

Please sign in to comment.