mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Null-check the parent before attempting to outerize. rs=brendan
This commit is contained in:
parent
8c66dc0bc9
commit
0bd2ff1b53
@ -1318,11 +1318,13 @@ nsDOMWindowUtils::GetParent()
|
||||
*rval = OBJECT_TO_JSVAL(parent);
|
||||
|
||||
// Outerize if necessary. Embrace the ugliness!
|
||||
JSClass *clasp = JS_GetClass(cx, parent);
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = reinterpret_cast<JSExtendedClass *>(clasp);
|
||||
if (JSObjectOp outerize = xclasp->outerObject)
|
||||
*rval = OBJECT_TO_JSVAL(outerize(cx, parent));
|
||||
if (parent) {
|
||||
JSClass* clasp = JS_GET_CLASS(cx, parent);
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass* xclasp = reinterpret_cast<JSExtendedClass*>(clasp);
|
||||
if (JSObjectOp outerize = xclasp->outerObject)
|
||||
*rval = OBJECT_TO_JSVAL(outerize(cx, parent));
|
||||
}
|
||||
}
|
||||
|
||||
cc->SetReturnValueWasSet(PR_TRUE);
|
||||
|
@ -3676,11 +3676,13 @@ Parent(JSContext *cx, uintN argc, jsval *vp)
|
||||
*vp = OBJECT_TO_JSVAL(parent);
|
||||
|
||||
/* Outerize if necessary. Embrace the ugliness! */
|
||||
JSClass *clasp = JS_GET_CLASS(cx, parent);
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = reinterpret_cast<JSExtendedClass *>(clasp);
|
||||
if (JSObjectOp outerize = xclasp->outerObject)
|
||||
*vp = OBJECT_TO_JSVAL(outerize(cx, parent));
|
||||
if (parent) {
|
||||
JSClass *clasp = JS_GET_CLASS(cx, parent);
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = reinterpret_cast<JSExtendedClass *>(clasp);
|
||||
if (JSObjectOp outerize = xclasp->outerObject)
|
||||
*vp = OBJECT_TO_JSVAL(outerize(cx, parent));
|
||||
}
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user