Skip to content

Commit 68a37a2

Browse files
committed
[Fix] App crash when no handler (_messageHandler) for message from JS.
1 parent 10a214b commit 68a37a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

WebViewJavascriptBridge/WebViewJavascriptBridge.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ - (void)_flushMessageQueue {
196196
}
197197
} else {
198198
handler = _messageHandler;
199+
if (!handler) {
200+
NSLog(@"WVJB Warning: No handler for message from JS: %@", message);
201+
return responseCallback(@{});
202+
}
199203
}
200204

201205
@try {

0 commit comments

Comments
 (0)