diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 0a903360f544..7556d672fd90 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -493,10 +493,16 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request, if (downloadError) { LOG(("nsUrlClassifierStreamUpdater::Download error [this=%p]", this)); - mDownloadErrorCallback->HandleEvent(strStatus); + + // It's possible for mDownloadErrorCallback to be null on shutdown. + if (mDownloadErrorCallback) { + mDownloadErrorCallback->HandleEvent(strStatus); + } + mDownloadError = true; status = NS_ERROR_ABORT; } else if (NS_SUCCEEDED(status)) { + MOZ_ASSERT(mDownloadErrorCallback); mBeganStream = true; LOG(("nsUrlClassifierStreamUpdater::Beginning stream [this=%p]", this)); rv = mDBService->BeginStream(mStreamTable);