ソースを参照

fix(android): Fix ClassCastException when doing native things(#987)

Nikhil Chitlur Navakiran 4 年 前
コミット
7e68da4ffe
共有1 個のファイルを変更した3 個の追加1 個の削除を含む
  1. 3
    1
      android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java

+ 3
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java ファイルの表示

@@ -1020,7 +1020,9 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
1020 1020
     @Override
1021 1021
     public void setWebViewClient(WebViewClient client) {
1022 1022
       super.setWebViewClient(client);
1023
-      mRNCWebViewClient = (RNCWebViewClient) client;
1023
+      if (client instanceof RNCWebViewClient) {
1024
+        mRNCWebViewClient = (RNCWebViewClient) client;
1025
+      }
1024 1026
     }
1025 1027
 
1026 1028
     public @Nullable