mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 933219 - Fix compartment mismatch in MobileMessageManager::Send. r=gwagner
This commit is contained in:
parent
38437c12c8
commit
6ee70a7c81
@ -181,10 +181,13 @@ MobileMessageManager::Send(const JS::Value& aNumber_,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_STATE(sc);
|
||||
|
||||
JS::Rooted<JSObject*> global(aCx, sc->GetWindowProxy());
|
||||
NS_ASSERTION(global, "Failed to get global object!");
|
||||
JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
|
||||
|
||||
JSAutoCompartment ac(aCx, global);
|
||||
mozilla::Maybe<JSAutoCompartment> ac;
|
||||
if (!global) {
|
||||
global = sc->GetWindowProxy();
|
||||
ac.construct(aCx, global);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(smsService, NS_ERROR_FAILURE);
|
||||
|
Loading…
Reference in New Issue
Block a user