From 5ad5598a19dc0d90d9166aa67a06bf48697631fe Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 30 Jul 2016 17:49:37 -0400 Subject: [PATCH] Make sure update directory != nil during cleanup --- Autoupdate/AppInstaller.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 3ded2aa9..5a70705c 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -607,9 +607,11 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; [self.agentConnection invalidate]; self.agentConnection = nil; - NSError *theError = nil; - if (![[[SUFileManager alloc] init] removeItemAtURL:[NSURL fileURLWithPath:self.updateDirectoryPath] error:&theError]) { - SULog(@"Couldn't remove update folder: %@.", theError); + if (self.updateDirectoryPath != nil) { + NSError *theError = nil; + if (![[[SUFileManager alloc] init] removeItemAtURL:[NSURL fileURLWithPath:self.updateDirectoryPath] error:&theError]) { + SULog(@"Couldn't remove update folder: %@.", theError); + } } exit(status);