Browse Source

Merge pull request #10516 from electron/fix_notification_crash

Fixed potential crash in Win32 notifications.
Cheng Zhao 7 years ago
parent
commit
ec587032b2

+ 1 - 0
brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc

@@ -325,6 +325,7 @@ HWND DesktopNotificationController::GetToast(
     const NotificationData* data) const {
     auto it = find_if(instances_.cbegin(), instances_.cend(),
         [data](auto&& inst) {
+            if (!inst.hwnd) return false;
             auto toast = Toast::Get(inst.hwnd);
             return data == toast->GetNotification().get();
         });