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 524420 9ff4178c5e2d278c8b0e7a25f1f6bb5b5bd8b217
parent 524419 7b85bf9c5210e5679fa6cfad92466a6e2ba30232
child 524421 35825a8005ab0f60ec24b2655e771d090f6c36d6
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [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();