Skip to content

Added null Protection for getAcademy #6532

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

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

IllianiBird
Copy link
Collaborator

  • Addressed a potential null academy issue in EducationController by adding a validation check and returning early if the academy is not found.
  • Annotated getAcademy method with @Nullable to clearly indicate possible null return values.
  • Refactored and improved code formatting consistency across multiple files:
    • Simplified logical conditions and improved readability.
    • Adjusted indentation, line breaks, and spacing for better clarity.

Dev Notes

Predominately this fixes an issue with personnel the player has manually assigned to the STUDENT status.

- Addressed a potential `null` academy issue in `EducationController` by adding a validation check and returning early if the academy is not found.
- Annotated `getAcademy` method with `@Nullable` to clearly indicate possible null return values.
- Refactored and improved code formatting consistency across multiple files:
  - Simplified logical conditions and improved readability.
  - Adjusted indentation, line breaks, and spacing for better clarity.
@IllianiBird IllianiBird added Bug Severity: Medium Issues described as medium severity as per the new issue form labels Apr 1, 2025
@IllianiBird IllianiBird self-assigned this Apr 1, 2025
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.27%. Comparing base (0496d05) to head (f70d634).
Report is 51 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6532      +/-   ##
============================================
- Coverage     11.28%   11.27%   -0.01%     
+ Complexity     6321     6318       -3     
============================================
  Files          1080     1080              
  Lines        137543   137563      +20     
  Branches      21300    21301       +1     
============================================
- Hits          15517    15511       -6     
- Misses       120473   120497      +24     
- Partials       1553     1555       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rjhancock rjhancock merged commit 3c4dba4 into MegaMek:master Apr 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Severity: Medium Issues described as medium severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants