From ef8edef0943ec1afe0159ef5d7f058d47e103ff5 Mon Sep 17 00:00:00 2001 From: Uli Kusterer Date: Sat, 16 Mar 2013 16:58:37 +0100 Subject: [PATCH] Don't look at error variables if result says success. --- SUPlainInstallerInternals.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SUPlainInstallerInternals.m b/SUPlainInstallerInternals.m index 15eb16b4..75a99110 100644 --- a/SUPlainInstallerInternals.m +++ b/SUPlainInstallerInternals.m @@ -496,7 +496,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza // We better move the old version back to its old location if( hadFileAtDest ) success = [manager moveItemAtPath:tmpPath toPath:dst error:error]; - if (error != NULL) + if (!success && error != NULL) *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]]; return NO;