Bug 1172717 - Fail on UNKNOWN_APP_ID instead of crashing. r=bholley a=RyanVM

This commit is contained in:
Nikhil Marathe 2015-06-08 16:18:09 -07:00
parent f1f794f19b
commit 29d8e53169

View File

@ -2546,6 +2546,11 @@ ServiceWorkerManager::GetServiceWorkerRegistrationInfo(nsIPrincipal* aPrincipal,
MOZ_ASSERT(aPrincipal);
MOZ_ASSERT(aURI);
//XXXnsm Temporary fix until Bug 1171432 is fixed.
if (NS_WARN_IF(BasePrincipal::Cast(aPrincipal)->AppId() == nsIScriptSecurityManager::UNKNOWN_APP_ID)) {
return nullptr;
}
nsAutoCString originAttributesSuffix;
nsresult rv = PrincipalToScopeKey(aPrincipal, originAttributesSuffix);
if (NS_WARN_IF(NS_FAILED(rv))) {