mirror of https://github.com/axmolengine/axmol.git
Merge pull request #11820 from Dimon4eg/v3
Fix crash in web view if illegal character in url (Android only)
This commit is contained in:
commit
5e776381aa
|
@ -58,11 +58,16 @@ public class Cocos2dxWebView extends WebView {
|
|||
class Cocos2dxWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String urlString) {
|
||||
URI uri = URI.create(urlString);
|
||||
if (uri != null && uri.getScheme().equals(mJSScheme)) {
|
||||
Cocos2dxWebViewHelper._onJsCallback(mViewTag, urlString);
|
||||
return true;
|
||||
try {
|
||||
URI uri = URI.create(urlString);
|
||||
if (uri != null && uri.getScheme().equals(mJSScheme)) {
|
||||
Cocos2dxWebViewHelper._onJsCallback(mViewTag, urlString);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, "Failed to create URI from url");
|
||||
}
|
||||
|
||||
return Cocos2dxWebViewHelper._shouldStartLoading(mViewTag, urlString);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue