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

Added Exception Handling for Out-of_Bounds Tab Index Selection #5788

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

IllianiCBT
Copy link
Collaborator

  • Encapsulated tab index selection logic in a try-catch block to prevent crashes when the index is out of bounds.
  • Ignored exceptions as the default behavior safely skips selection if the index is invalid.
  • Added a comment to clarify this behavior.

Fix #5751

Encapsulated tab index selection logic in a try-catch block to prevent crashes when the index is out of bounds. Ignored exceptions as the default behavior safely skips selection if the index is invalid. Added a comment to clarify this behavior.
Changed the catch block to handle ArrayIndexOutOfBoundsException instead of a generic Exception. This improves code clarity and ensures only relevant exceptions are handled in this context.
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.18%. Comparing base (7dcf890) to head (7bc7bb5).
Report is 55 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5788      +/-   ##
============================================
- Coverage     10.21%   10.18%   -0.04%     
+ Complexity     6077     6062      -15     
============================================
  Files          1010     1011       +1     
  Lines        139311   139504     +193     
  Branches      20449    20503      +54     
============================================
- Hits          14231    14203      -28     
- Misses       123711   123925     +214     
- Partials       1369     1376       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HammerGS HammerGS merged commit bd42a82 into MegaMek:master Jan 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.50.03-SNAPSHOT] NPE when clicking on unit in TO&E with no pilot
3 participants