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

Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
trop[bot]
2020-10-02 13:58:04 -07:00
committed by GitHub
parent 9f21accfc2
commit c8f9d0908a

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 {