[NullChecks] Catch crashes when loading corrupted coordinate files #86
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IllusionMods/IllusionFixes!86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull Request Overview
This PR adds protection against crashes when loading corrupted coordinate files in the NullChecks plugin. The changes implement exception handling for
ChaFileCoordinate.LoadFilemethod to catch and log crashes gracefully instead of crashing the game.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -39,6 +41,25 @@ namespace IllusionFixeselseThe
First()method will throw anInvalidOperationExceptionif no matching method is found, making the null check on line 49 unreachable. UseFirstOrDefault()instead ofFirst()to properly handle the case where the method is not found.The finalizer variable references
MethodNullRefEater, but the new methodChaFileCoordinate_LoadFile_CrashEateris defined and never used. The patch should use a finalizer pointing toChaFileCoordinate_LoadFile_CrashEaterinstead, asMethodNullRefEaterdoesn't have the correct signature (missingStream standref bool __resultparameters) to handle this patch properly.