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 5796: Safety check for entities with no hex location, e.g. just-loaded infantry #5814

Merged
merged 2 commits into from
Jul 28, 2024

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Jul 28, 2024

Prevents the NPE when hex is null due to the unit having just been loaded the previous Movement phase.

Testing:

  • Ran saves from OP with and without fix, and confirmed via debugging that the just-loaded unit was at fault.
  • Ran all 3 projects' unit tests

Close #5796

@Sleet01 Sleet01 requested a review from IllianiCBT July 28, 2024 08:33
Copy link

codecov bot commented Jul 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.05%. Comparing base (8b06aec) to head (f797f83).
Report is 34 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5814      +/-   ##
============================================
- Coverage     29.06%   29.05%   -0.01%     
+ Complexity    13913    13911       -2     
============================================
  Files          2507     2507              
  Lines        266339   266366      +27     
  Branches      47611    47621      +10     
============================================
- Hits          77403    77400       -3     
- Misses       185012   185033      +21     
- Partials       3924     3933       +9     

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

@Sleet01 Sleet01 merged commit f50606e into MegaMek:master Jul 28, 2024
5 checks passed
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.

MegaMek battle received error "uncaught java.lang.NullPointerException detected."
2 participants