fix(android): add null reference check for onMessage on android (#770)

This commit is contained in:
Roc 2019-08-09 16:53:00 +08:00 committed by Thibault Malbranche
parent 9250c054c6
commit 12db6956a9
1 changed files with 3 additions and 0 deletions

View File

@ -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));