Cancels AltBackup installation if error has already been thrown

This commit is contained in:
Riley Testut
2021-09-15 14:29:37 -07:00
parent f9d66e0a78
commit f7c797e0b0

View File

@@ -1325,6 +1325,12 @@ private extension AppManager
{ {
let progress = Progress.discreteProgress(totalUnitCount: 100) let progress = Progress.discreteProgress(totalUnitCount: 100)
if let error = context.error
{
completionHandler(.failure(error))
return progress
}
guard let application = ALTApplication(fileURL: app.fileURL) else { guard let application = ALTApplication(fileURL: app.fileURL) else {
completionHandler(.failure(OperationError.appNotFound)) completionHandler(.failure(OperationError.appNotFound))
return progress return progress
@@ -1391,6 +1397,8 @@ private extension AppManager
catch catch
{ {
print(error) print(error)
context.error = error
} }
operation.finish() operation.finish()