Bug 1533482, null check mProxy in MaybeDispatchPrematureAbortEvents to follow what is done in ::Open (bug 1192350), r=baku
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Mon, 11 Mar 2019 13:30:59 +0000
changeset 521422 9ff4178c5e2d
parent 521421 7b85bf9c5210
child 521423 35825a8005ab
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1533482, 1192350
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533482, null check mProxy in MaybeDispatchPrematureAbortEvents to follow what is done in ::Open (bug 1192350), r=baku Differential Revision: https://phabricator.services.mozilla.com/D22727
dom/xhr/XMLHttpRequestWorker.cpp
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -1588,16 +1588,22 @@ void XMLHttpRequestWorker::MaybeDispatch
       return;
     }
 
     DispatchPrematureAbortEvent(this, NS_LITERAL_STRING("loadend"), false, aRv);
     if (aRv.Failed()) {
       return;
     }
 
+    // Similarly to null check in ::Open, mProxy may have been cleared here.
+    if (!mProxy) {
+      aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+      return;
+    }
+
     mProxy->mSeenLoadStart = false;
   }
 }
 
 void XMLHttpRequestWorker::DispatchPrematureAbortEvent(
     EventTarget* aTarget, const nsAString& aEventType, bool aUploadTarget,
     ErrorResult& aRv) {
   mWorkerPrivate->AssertIsOnWorkerThread();