Bug 1226400 - throw an error in addition to returning null. r=bz
authorJohn Daggett <jdaggett@mozilla.com>
Fri, 27 Nov 2015 08:20:55 +0900
changeset 311686 3c376f3b77e414da3196c9697d3df2d5b9186294
parent 311685 4bd763798dbf7e49da5f17bc48c5de7e3d1487c3
child 311687 e9fee5618ac1e94d66faab5885a35a71e19c2867
push id7905
push userrocallahan@mozilla.com
push dateFri, 27 Nov 2015 08:10:53 +0000
reviewersbz
bugs1226400
milestone45.0a1
Bug 1226400 - throw an error in addition to returning null. r=bz
layout/style/FontFaceSet.cpp
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -342,16 +342,17 @@ FontFaceSet::Load(JSContext* aCx,
     if (!promises.AppendElement(promise, fallible)) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
   }
 
   nsIGlobalObject* globalObject = GetParentObject();
   if (!globalObject) {
+    aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   JS::Rooted<JSObject*> jsGlobal(aCx, globalObject->GetGlobalJSObject());
   GlobalObject global(aCx, jsGlobal);
 
   RefPtr<Promise> result = Promise::All(global, promises, aRv);
   return result.forget();