Bug 1956233 - avoid getting URI prefs when not contentprincipal. r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D242919
This commit is contained in:
@@ -1067,6 +1067,12 @@ NS_IMETHODIMP
|
|||||||
BasePrincipal::IsURIInPrefList(const char* aPref, bool* aResult) {
|
BasePrincipal::IsURIInPrefList(const char* aPref, bool* aResult) {
|
||||||
AssertIsOnMainThread();
|
AssertIsOnMainThread();
|
||||||
*aResult = false;
|
*aResult = false;
|
||||||
|
|
||||||
|
if (Kind() != eContentPrincipal) {
|
||||||
|
// We don't store prefs for non-content principals.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> prinURI;
|
nsCOMPtr<nsIURI> prinURI;
|
||||||
nsresult rv = GetURI(getter_AddRefs(prinURI));
|
nsresult rv = GetURI(getter_AddRefs(prinURI));
|
||||||
if (NS_FAILED(rv) || !prinURI) {
|
if (NS_FAILED(rv) || !prinURI) {
|
||||||
|
|||||||
Reference in New Issue
Block a user