Browse Source

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

Nikhil Chitlur Navakiran 5 years ago
parent
commit
7e68da4ffe

+ 3
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

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