Bug 1589246 - Guard against null notification when closing them on Android r=geckoview-reviewers,droeh

Differential Revision: https://phabricator.services.mozilla.com/D50642

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Willcox 2019-10-25 18:06:09 +00:00
parent ef710a9a0f
commit 545ae39527

View File

@ -106,6 +106,10 @@ AndroidAlerts::CloseAlert(const nsAString& aAlertName,
nsIPrincipal* aPrincipal) {
java::WebNotification::LocalRef notification =
mNotificationsMap.Get(aAlertName);
if (!notification) {
return NS_OK;
}
java::GeckoRuntime::LocalRef runtime = java::GeckoRuntime::GetInstance();
if (runtime != NULL) {
runtime->NotifyOnClose(notification);