Skip to content

Commit

Permalink
prevent insert nil into dic
Browse files Browse the repository at this point in the history
  • Loading branch information
远尘 committed Mar 12, 2014
1 parent 47d9a9a commit 1dc0273
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ - (void)_flushMessageQueue {
NSString* callbackId = message[@"callbackId"];
if (callbackId) {
responseCallback = ^(id responseData) {
if (responseData == nil) {
responseData = @{};
}

WVJBMessage* msg = @{ @"responseId":callbackId, @"responseData":responseData };
[self _queueMessage:msg];
};
Expand Down

0 comments on commit 1dc0273

Please sign in to comment.