mirror of
https://github.com/electron/electron.git
synced 2026-01-24 23:08:10 -05:00
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:
@@ -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));
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user