diff --git a/docshell/base/BaseHistory.cpp b/docshell/base/BaseHistory.cpp index 7ef5076e6fb8..b39c33bbaef2 100644 --- a/docshell/base/BaseHistory.cpp +++ b/docshell/base/BaseHistory.cpp @@ -80,7 +80,10 @@ void BaseHistory::RegisterVisitedCallback(nsIURI* aURI, Link* aLink) { } if (!CanStore(aURI)) { - return aLink->VisitedQueryFinished(/* visited = */ false); + if (aLink) { + aLink->VisitedQueryFinished(/* visited = */ false); + } + return; } // Obtain our array of observers for this URI.