Skip to content

Commit

Permalink
If a response callback gets called with a nil response value, then …
Browse files Browse the repository at this point in the history
…replace that value with `[NSNull null]` instead of `@{}`. This way the javascript will receive a `null` value instead of `{}`. See gh pr marcuswestin#73
  • Loading branch information
marcuswestin committed May 23, 2014
1 parent 095f90d commit 8a60345
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WebViewJavascriptBridge/WebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ - (void)_flushMessageQueue {
if (callbackId) {
responseCallback = ^(id responseData) {
if (responseData == nil) {
responseData = @{};
responseData = [NSNull null];
}

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

0 comments on commit 8a60345

Please sign in to comment.