Kaynağa Gözat

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

Nikhil Chitlur Navakiran 5 yıl önce
ebeveyn
işleme
7e68da4ffe

+ 3
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java Dosyayı Görüntüle

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