Merge pull request #8 from hypothermic/master
Fix NullPointerException in MyWebViewClient
This commit is contained in:
commit
1e48553263
@ -12,7 +12,8 @@ class MyWebViewClient extends WebViewClient {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
if (Objects.requireNonNull(Uri.parse(url).getHost()).endsWith("example.com")) {
|
||||
Uri uri = Uri.parse(url);
|
||||
if (uri.getHost() != null && uri.getHost().contains("example.com")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -20,4 +21,4 @@ class MyWebViewClient extends WebViewClient {
|
||||
view.getContext().startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user