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

Fix uncaught overflow exception when parsing NetEntities from strings. #4989

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

Tayrtahn
Copy link
Member

@Tayrtahn Tayrtahn commented Mar 23, 2024

Passing a string representing a number that can't fit in an Int32 to NetEntity.TryParse causes an OverflowException to be thrown by int.Parse, which isn't caught by the try/catch block. This could cause logic (like RenameCommand) to abort prematurely, and other possible problems.

This change catches the exception in NetEntity.TryParse and handles it the same way as it already handles FormatExceptions.

@PJB3005 PJB3005 merged commit b9b565d into space-wizards:master Mar 23, 2024
4 checks passed
@Tayrtahn Tayrtahn deleted the netentity-parse-overflow-fix branch March 24, 2024 13:16
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