ソースを参照

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

Nikhil Chitlur Navakiran 5 年 前
コミット
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
     @Override
1020
     @Override
1021
     public void setWebViewClient(WebViewClient client) {
1021
     public void setWebViewClient(WebViewClient client) {
1022
       super.setWebViewClient(client);
1022
       super.setWebViewClient(client);
1023
-      mRNCWebViewClient = (RNCWebViewClient) client;
1023
+      if (client instanceof RNCWebViewClient) {
1024
+        mRNCWebViewClient = (RNCWebViewClient) client;
1025
+      }
1024
     }
1026
     }
1025
 
1027
 
1026
     public @Nullable
1028
     public @Nullable