mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Fix exception when old file doesn't exist
This commit is contained in:
parent
a15489f5e4
commit
e8538c22bc
@ -188,7 +188,12 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
||||
cachedFile?.cachedLocation?.let {
|
||||
if (destPath != Paths.get(packFolder, it)) {
|
||||
// Delete old file if location changes
|
||||
Files.delete(Paths.get(packFolder, cachedFile!!.cachedLocation))
|
||||
try {
|
||||
Files.delete(Paths.get(packFolder, cachedFile!!.cachedLocation))
|
||||
} catch (e: IOException) {
|
||||
// Continue, as it was probably already deleted?
|
||||
// TODO: log it
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user