diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp index 17e6453a82f2..cdce0a46420c 100644 --- a/js/src/vm/ObjectGroup.cpp +++ b/js/src/vm/ObjectGroup.cpp @@ -1335,7 +1335,7 @@ ObjectGroup::newPlainObject(ExclusiveContext* cx, IdValuePair* properties, size_ RootedPlainObject obj(cx, NewObjectWithGroup(cx, group, allocKind, newKind)); - if (!obj->setLastProperty(cx, shape)) + if (!obj || !obj->setLastProperty(cx, shape)) return nullptr; for (size_t i = 0; i < nproperties; i++)