From 181f3f61e0c263b5b600fcbf19c480818593b223 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 30 Sep 2015 14:02:48 +1000 Subject: [PATCH] Bug 1207312: P1. Prevent crash when more than one promise is rejected. r=bholley --- xpcom/threads/MozPromise.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index 160076ad067f..aa02f4974b28 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -237,6 +237,11 @@ private: void Reject(const RejectValueType& aRejectValue) { + if (!mPromise) { + // Already rejected. + return; + } + mPromise->Reject(aRejectValue, __func__); mPromise = nullptr; mResolveValues.Clear();