Index: chrome/browser/notifications/platform_notification_service_impl.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc |
index e8a668d30dfa1c77c4041830b5fcf9f3aca3ab3b..255ab55b9a4685b6283cd6235a07c0c94da2a17f 100644 |
--- a/chrome/browser/notifications/platform_notification_service_impl.cc |
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc |
@@ -416,15 +416,14 @@ void PlatformNotificationServiceImpl::ClosePersistentNotification( |
// generated by the caller of this method. |
GetNotificationDisplayService(profile)->Close( |
base::Int64ToString(persistent_notification_id)); |
+ } else { |
+ auto iter = persistent_notifications_.find(persistent_notification_id); |
+ if (iter == persistent_notifications_.end()) |
+ return; |
+ GetNotificationDisplayService(profile)->Close(iter->second); |
} |
- auto iter = persistent_notifications_.find(persistent_notification_id); |
- if (iter == persistent_notifications_.end()) |
- return; |
- |
- GetNotificationDisplayService(profile)->Close(iter->second); |
- |
- persistent_notifications_.erase(iter); |
+ persistent_notifications_.erase(persistent_notification_id); |
} |
bool PlatformNotificationServiceImpl::GetDisplayedPersistentNotifications( |