From ff355b7a6c831c26799cf453903cbdc981ce823d Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Sat, 15 Jul 2017 05:07:49 -0700 Subject: [PATCH] Mac uninstaller: fix incompatibility with OS 10.6 --- lib/mac/mac_util.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/mac/mac_util.mm b/lib/mac/mac_util.mm index 4978150ed5..aa36898ec7 100644 --- a/lib/mac/mac_util.mm +++ b/lib/mac/mac_util.mm @@ -50,9 +50,14 @@ void BringAppWithPidToFront(pid_t pid) { void getFrontMostApp(char * appName, size_t maxLen) { - NSRunningApplication * frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication]; - NSString * name = [frontApp localizedName]; - strlcpy(appName, [name UTF8String], maxLen); + if ([[NSWorkspace sharedWorkspace] respondsToSelector: @selector(frontmostApplication)]){ + NSRunningApplication * frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication]; + NSString * name = [frontApp localizedName]; + strlcpy(appName, [name UTF8String], maxLen); + } else { + // NSWorkspace frontmostApplication is not available in OS 10.6 + strlcpy(appName, "UserNotificationCenter", maxLen); + } }