Resort to default compartment when global object is set to NULL (r=crash on startup).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user