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