diff options
author | Moonchild <moonchild@palemoon.org> | 2023-08-30 17:46:49 +0200 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-08-30 17:46:49 +0200 |
commit | ca691c8d2dbd00957722028b5bc8322721879d86 (patch) | |
tree | 3516b57876fe785de62c444d684050c37999a728 | |
parent | 226f97e2f44b1bb2a9ad602fd7f5ef2c5a0dd5ac (diff) | |
download | uxp-ca691c8d2dbd00957722028b5bc8322721879d86.tar.gz |
[DOM] Deny web notifications if principal can't resolve.
-rw-r--r-- | dom/notification/Notification.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 9a7c833794..5439a4fe59 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -1688,6 +1688,11 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv) } nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal(); + if (!principal) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return NotificationPermission::Denied; + } + return GetPermissionInternal(principal, aRv); } |