fix: crash when application launched from UNUserNotificationCenter notification (#25702)

This commit is contained in:
Milan Burda 2020-10-02 04:52:07 +02:00 committed by GitHub
parent 5387b5b9b2
commit 17c7c5cfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {