Don't look at error variables if result says success.

This commit is contained in:
Uli Kusterer committed 2013-03-16 16:58:37 +01:00
1 parent c793adf2ed
commit ef8edef094
1 file changed
+1 -1
+1 -1
View File
@@ -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;