bug 1027634 - crash in java.net.MalformedURLException: Unknown protocol: textstyle at java.net.URL.<init>(URL.java) r=snorp

This commit is contained in:
Brad Lassey 2014-06-19 10:33:24 -04:00
parent 782d1b99f9
commit 56e1db7e51

View File

@ -2706,7 +2706,8 @@ public class GeckoAppShell
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)
static URLConnection getConnection(String url) throws MalformedURLException, IOException {
static URLConnection getConnection(String url) {
try {
String spec;
if (url.startsWith("android://")) {
spec = url.substring(10);
@ -2719,7 +2720,10 @@ public class GeckoAppShell
if (colon == -1 || colon > spec.indexOf('/')) {
spec = spec.replaceFirst("/", ":/");
}
return new URL(spec).openConnection();
} catch(Exception ex) {
return null;
}
return null;
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)