diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index 723a0882808..415f2217dfb 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -278,7 +278,9 @@ void RemoveFromLoginItems() { void Browser::SetLoginItemSettings(LoginItemSettings settings) { #if defined(MAS_BUILD) - platform_util::SetLoginItemEnabled(settings.open_at_login); + if (!platform_util::SetLoginItemEnabled(settings.open_at_login)) { + LOG(ERROR) << "Unable to set login item enabled on sandboxed app."; + } #else if (settings.open_at_login) base::mac::AddToLoginItems(settings.open_as_hidden); diff --git a/atom/common/platform_util.h b/atom/common/platform_util.h index bab1bbf7931..da36f56b67e 100644 --- a/atom/common/platform_util.h +++ b/atom/common/platform_util.h @@ -61,7 +61,7 @@ void Beep(); #if defined(OS_MACOSX) bool GetLoginItemEnabled(); -void SetLoginItemEnabled(bool enabled); +bool SetLoginItemEnabled(bool enabled); #endif #if defined(OS_LINUX) diff --git a/atom/common/platform_util_mac.mm b/atom/common/platform_util_mac.mm index 4cda8bf3ed2..afbf47cbec9 100644 --- a/atom/common/platform_util_mac.mm +++ b/atom/common/platform_util_mac.mm @@ -199,9 +199,9 @@ bool GetLoginItemEnabled() { return enabled; } -void SetLoginItemEnabled(bool enabled) { +bool SetLoginItemEnabled(bool enabled) { NSString* identifier = GetLoginHelperBundleIdentifier(); - SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled); + return SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled); } } // namespace platform_util