mirror of
https://github.com/expo/react-native-webview.git
synced 2026-11-15 09:18:06 -10:00
fix(android): add null reference check for onMessage on android (#770)
This commit is contained in:
1 parent
9250c054c6
commit
12db6956a9
1 file changed
+3
@@ -994,6 +994,9 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
||||
webView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mRNCWebViewClient == null) {
|
||||
return;
|
||||
}
|
||||
WritableMap data = mRNCWebViewClient.createWebViewEvent(webView, webView.getUrl());
|
||||
data.putString("data", message);
|
||||
dispatchEvent(webView, new TopMessageEvent(webView.getId(), data));
|
||||
|
||||
Reference in new issue
Block a user