mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 11:41:08 +00:00
fix(android): add null reference check for onMessage on android (#770)
This commit is contained in:
@@ -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