From 3b2ea83c6fdbb89aca0ec9638dfdb1745b9c999e Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 7 Jan 2017 11:22:13 -0500 Subject: [PATCH] Fix latest analyzer warnings --- Autoupdate/SUPlainInstaller.m | 4 +++- Sparkle/InstallerProgress/InstallerProgressAppController.m | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Autoupdate/SUPlainInstaller.m b/Autoupdate/SUPlainInstaller.m index 528b2d98..cb74f039 100644 --- a/Autoupdate/SUPlainInstaller.m +++ b/Autoupdate/SUPlainInstaller.m @@ -194,7 +194,9 @@ if (!updateVersion || [comparator compareVersion:hostVersion toVersion:updateVersion] == NSOrderedDescending) { NSString *errorMessage = [NSString stringWithFormat:@"For security reasons, updates that downgrade version of the application are not allowed. Refusing to downgrade app from version %@ to %@. Aborting update.", hostVersion, [bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey]]; - *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{ NSLocalizedDescriptionKey: errorMessage }]; + if (error != NULL) { + *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{ NSLocalizedDescriptionKey: errorMessage }]; + } return NO; } diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index 4dde78ea..da8a58de 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -79,6 +79,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; if (hostBundleIdentifier == nil) { SULog(SULogLevelError, @"Error: Host bundle identifier for target is nil"); [self cleanupAndExitWithStatus:EXIT_FAILURE]; + return nil; // just to silence analyzer warnings later about hostBundleIdentifier being nil } // Note that we are connecting to the installer rather than the installer connecting to us