Bug 1417498 - Account for aRequest being null in onLocationChange. r=JanH

According to the documentation, aRequest may be null in some cases, and one such
case is when the location change was caused by a page using the history API.

MozReview-Commit-ID: AUlHBgzaKDX

--HG--
extra : rebase_source : a51770f17242f899adc566a3ebd8c09357600ef9
This commit is contained in:
Jan Henning 2017-11-17 19:50:04 +01:00
Родитель c14fee40ff
Коммит 257ecaca74
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -4435,7 +4435,9 @@ Tab.prototype = {
// In restricted profiles, we refuse to let you open various urls.
if (!ParentalControls.isAllowed(ParentalControls.BROWSE, fixedURI)) {
aRequest.cancel(Cr.NS_BINDING_ABORTED);
if (aRequest) {
aRequest.cancel(Cr.NS_BINDING_ABORTED);
}
this.browser.docShell.displayLoadError(Cr.NS_ERROR_UNKNOWN_PROTOCOL, fixedURI, null);
}
@ -4500,7 +4502,7 @@ Tab.prototype = {
ExternalApps.updatePageActionUri(fixedURI);
}
if (Components.isSuccessCode(aRequest.status) &&
if ((!aRequest || Components.isSuccessCode(aRequest.status)) &&
!fixedURI.displaySpec.startsWith("about:neterror") && !this.isSearch) {
// If this won't end up in an error page and the user isn't searching,
// don't retain the typed entry.