Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch corrupted files #4189

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

RacoonDog
Copy link
Contributor

Type of change

  • Bug fix
  • New feature

Description

Here's a fun fact! Did you know the NbtIo.read() javadoc is wrong?
image
Yep! They actually catch IOException's and rethrow them as CrashException's, which are not a subclass of IOException and not stated in the javadoc.
Anyways this PR catches those and prevents it from crashing the game, as well as creating a backup before overwriting the erroring settings.
Note: I kept the IOException catch and explicitly didn't make it create a backup, as that would indicate something might be wrong with the backup process, or IO operations. It will still allow the game to run, it will just overwrite the settings.

How Has This Been Tested?

image

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@Wide-Cat Wide-Cat merged commit 775b8c3 into MeteorDevelopment:master Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants