Bug 681061 - Avoid compartment mismatch error when displaying a growl notification. r=mrbkap

This commit is contained in:
Josh Matthews 2011-08-22 17:20:52 -04:00
parent b7beb63b85
commit 20a7be87b7

View File

@ -79,6 +79,10 @@ GetWindowOfObserver(nsIObserver* aObserver)
NS_ENSURE_SUCCESS(rv, nsnull);
JSAutoRequest ar(cx);
JSAutoEnterCompartment ac;
if (!ac.enter(cx, obj)) {
return nsnull;
}
JSObject* global = JS_GetGlobalForObject(cx, obj);
NS_ENSURE_TRUE(global, nsnull);