Bug 1079707 - asyncresolve can throw, r=alexbardas
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -777,17 +777,25 @@ function gKeywordURIFixup({ target: brow
];
let notification =
notificationBox.appendNotification(message,"keyword-uri-fixup", null,
notificationBox.PRIORITY_INFO_HIGH,
buttons);
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.
// This function is responsible for loading the page in the correct process.
function RedirectLoad({ target: browser, data }) {
let tab = gBrowser.getTabForBrowser(browser);
// Flush the tab state before getting it
TabState.flush(browser);