launcher
launcher copied to clipboard
Handle corrupted files without early exit
- Catch whole IOException from hash method - this can throw IOException when the file is corrupted
- When destination file already existings but hash is invalid, delete destination file because it is most likely corrupted
Closes #53
Signed-off-by: Tomas Slusny [email protected]
Reference: https://github.com/runelite/runelite/issues/7873
Any update on this @Adam- ?
I am pretty sure that the launcher already handles corrupt files correctly since creating a new FileOutputStream on a file overwrites it. #7873 looks like some sort of disk i/o error.
Well, the change that prevents the corrupted files from crashing launcher is this https://github.com/runelite/launcher/pull/52/files#diff-818c02b00d346005372c6180a5539eacR307
And then the .delete() deletes that file just in case before creating new output stream