From abb60ecd2ee58226b8c83249cd388ed028ffed69 Mon Sep 17 00:00:00 2001 From: Adam Buckland Date: Sun, 1 May 2016 11:25:27 +0100 Subject: [PATCH] Fix autoUpdater error on OS X If there is no localizedFailureReason, then then this will no longer be added to the error string (which would result previously in it printing '(null)' as part of the string) --- atom/browser/auto_updater_mac.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/atom/browser/auto_updater_mac.mm b/atom/browser/auto_updater_mac.mm index 9af920f59299..edc6972d16d3 100644 --- a/atom/browser/auto_updater_mac.mm +++ b/atom/browser/auto_updater_mac.mm @@ -90,9 +90,14 @@ void AutoUpdater::CheckForUpdates() { delegate->OnUpdateNotAvailable(); } } error:^(NSError *error) { - delegate->OnError(base::SysNSStringToUTF8( - [NSString stringWithFormat:@"%@: %@", - error.localizedDescription, error.localizedFailureReason])); + NSString *failureString; + if(error.localizedFailureReason) { + failureString = [NSString stringWithFormat:@"%@: %@", + error.localizedDescription, error.localizedFailureReason]; + } else { + failureString = [NSString stringWithString: error.localizedDescription]; + } + delegate->OnError(base::SysNSStringToUTF8(failureString)); }]; }