From 17c7c5cfddc1007b6e227810ede80b6e0372ca82 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Fri, 2 Oct 2020 04:52:07 +0200 Subject: [PATCH] fix: crash when application launched from UNUserNotificationCenter notification (#25702) --- shell/browser/mac/electron_application_delegate.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/browser/mac/electron_application_delegate.mm b/shell/browser/mac/electron_application_delegate.mm index 4dabcabc0d80..15e445668006 100644 --- a/shell/browser/mac/electron_application_delegate.mm +++ b/shell/browser/mac/electron_application_delegate.mm @@ -69,9 +69,9 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - (void)applicationDidFinishLaunching:(NSNotification*)notify { NSUserNotification* user_notification = - [notify userInfo][(id) @"NSApplicationLaunchUserNotificationKey"]; + [notify userInfo][NSApplicationLaunchUserNotificationKey]; - if (user_notification.userInfo) { + if ([user_notification isKindOfClass:[NSUserNotification class]]) { electron::Browser::Get()->DidFinishLaunching( electron::NSDictionaryToDictionaryValue(user_notification.userInfo)); } else {