Skip to content

Commit 8a60345

Browse files
committed
If a response callback gets called with a nil response value, then replace that value with [NSNull null] instead of @{}. This way the javascript will receive a null value instead of {}. See gh pr marcuswestin#73
1 parent 095f90d commit 8a60345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WebViewJavascriptBridge/WebViewJavascriptBridge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ - (void)_flushMessageQueue {
175175
if (callbackId) {
176176
responseCallback = ^(id responseData) {
177177
if (responseData == nil) {
178-
responseData = @{};
178+
responseData = [NSNull null];
179179
}
180180

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

0 commit comments

Comments
 (0)