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);