Bug 1254503 - Ignore exceptions from trying to fix up obviously broken URIs. r=mak, a=sledru
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 08 Mar 2016 17:12:01 +0000
changeset 313262 a149bbca9351b2562c3db8f200961751e01760b4
parent 313261 0c900c7700094ca9bc3a14b996a5660649e272dd
child 313263 18d6afbda28ced478731e1da2e8db262676f9bdc
push id1061
push userryanvm@gmail.com
push dateTue, 15 Mar 2016 18:13:07 +0000
treeherdermozilla-release@c728f7d9d0dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, sledru
bugs1254503
milestone45.0
Bug 1254503 - Ignore exceptions from trying to fix up obviously broken URIs. r=mak, a=sledru MozReview-Commit-ID: 7fdJZmtc1zK
browser/base/content/utilityOverlay.js
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -748,19 +748,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;