Resort to default compartment when global object is set to NULL (r=crash on startup).

This commit is contained in:
Andreas Gal
2010-06-24 20:13:22 -05:00
parent 577ba46646
commit 1c809f8af0

View File

@@ -1139,7 +1139,7 @@ JS_SetGlobalObject(JSContext *cx, JSObject *obj)
CHECK_REQUEST(cx);
cx->globalObject = obj;
cx->compartment = obj->getCompartment(cx);
cx->compartment = obj ? obj->getCompartment(cx) : cx->runtime->defaultCompartment;
}
JS_BEGIN_EXTERN_C