Bug 1254503 - ignore exceptions from trying to fix up obviously broken URIs, r?mak draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 08 Mar 2016 17:12:01 +0000
changeset 338139 0b0620a9e9c67900cd9a19aa0362118285de9ff5
parent 338138 614ad511d86108ae9fc18b4c886725629fd73999
child 515737 d85e338ba9f6eb378601019abef0158305355bb8
push id12442
push usergijskruitbosch@gmail.com
push dateTue, 08 Mar 2016 17:12:48 +0000
reviewersmak
bugs1254503
milestone47.0a1
Bug 1254503 - ignore exceptions from trying to fix up obviously broken URIs, r?mak MozReview-Commit-ID: 7fdJZmtc1zK
browser/base/content/utilityOverlay.js
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -746,19 +746,19 @@ function trimURL(aURL) {
   // remove http://
   if (!url.startsWith("http://")) {
     return url;
   }
   let urlWithoutProtocol = url.substring(7);
 
   let flags = Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
               Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
-  let fixedUpURL = Services.uriFixup.createFixupURI(urlWithoutProtocol, flags);
-  let expectedURLSpec;
+  let fixedUpURL, expectedURLSpec;
   try {
+    fixedUpURL = Services.uriFixup.createFixupURI(urlWithoutProtocol, flags);
     expectedURLSpec = makeURI(aURL).spec;
   } catch (ex) {
     return url;
   }
   if (fixedUpURL.spec == expectedURLSpec) {
     return urlWithoutProtocol;
   }
   return url;