From 545ae395276ad6b8683b1d1c258d88638f0931a3 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Fri, 25 Oct 2019 18:06:09 +0000 Subject: [PATCH] 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 --- widget/android/AndroidAlerts.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/android/AndroidAlerts.cpp b/widget/android/AndroidAlerts.cpp index 2336007dd7a3..f7a8704d6645 100644 --- a/widget/android/AndroidAlerts.cpp +++ b/widget/android/AndroidAlerts.cpp @@ -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);