Make sure we have a JSObject before trying to get global.
parent
1fb3124661
commit
7dd71e41e4
|
@ -485,7 +485,13 @@ AutoJSAPI::Init(nsIGlobalObject* aGlobalObject)
|
|||
bool
|
||||
AutoJSAPI::Init(JSObject* aObject)
|
||||
{
|
||||
return Init(xpc::NativeGlobal(aObject));
|
||||
nsIGlobalObject* global = nullptr;
|
||||
if (aObject)
|
||||
global = xpc::NativeGlobal(aObject);
|
||||
if (global)
|
||||
return Init(global);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in New Issue