From 21601544ab65249e73caf83d0e978427349a2a08 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Thu, 16 Oct 2014 15:01:32 -0700 Subject: [PATCH] Bug 1079707 - asyncresolve can throw, r=alexbardas --HG-- extra : rebase_source : e1a83fed31780d9e1d56dc795e157e17525ff9f6 --- browser/base/content/browser.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index e5a2d47c94a..e5574c86add 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -782,7 +782,15 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) { notification.persistence = 1; }; - gDNSService.asyncResolve(hostName, 0, onLookupComplete, Services.tm.mainThread); + try { + gDNSService.asyncResolve(hostName, 0, onLookupComplete, Services.tm.mainThread); + } catch (ex) { + // Do nothing if the URL is invalid (we don't want to show a notification in that case). + if (ex.result != Cr.NS_ERROR_UNKNOWN_HOST) { + // ... otherwise, report: + Cu.reportError(ex); + } + } } // Called when a docshell has attempted to load a page in an incorrect process.