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)
This commit is contained in:
Adam Buckland 2016-05-01 11:25:27 +01:00
parent 586e5e2ba5
commit abb60ecd2e

View file

@ -90,9 +90,14 @@ void AutoUpdater::CheckForUpdates() {
delegate->OnUpdateNotAvailable(); delegate->OnUpdateNotAvailable();
} }
} error:^(NSError *error) { } error:^(NSError *error) {
delegate->OnError(base::SysNSStringToUTF8( NSString *failureString;
[NSString stringWithFormat:@"%@: %@", if(error.localizedFailureReason) {
error.localizedDescription, error.localizedFailureReason])); failureString = [NSString stringWithFormat:@"%@: %@",
error.localizedDescription, error.localizedFailureReason];
} else {
failureString = [NSString stringWithString: error.localizedDescription];
}
delegate->OnError(base::SysNSStringToUTF8(failureString));
}]; }];
} }