Skip to content

Commit

Permalink
Don't throw exception if deb is already removed
Browse files Browse the repository at this point in the history
  • Loading branch information
danpashin committed Jun 16, 2024
1 parent c5f23c3 commit 558d8a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion twackup-gui/Twackup/Sources/Models/Database/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ actor Database {
}

for pkg in packages {
try FileManager.default.removeItem(at: pkg.fileURL)
let manager = FileManager.default
let path = pkg.fileURL.path
if manager.fileExists(atPath: path) {
try manager.removeItem(atPath: path)
}
}

let request = NSBatchDeleteRequest(objectIDs: packages.map { $0.databaseID })
Expand Down

0 comments on commit 558d8a4

Please sign in to comment.