8000 Fix #6785: Fixed NPE on New Contract when Negotiator Lacks Negotiation Skill by IllianiBird · Pull Request #6786 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix #6785: Fixed NPE on New Contract when Negotiator Lacks Negotiation Skill #6786

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 1 commit into from
Apr 26, 2025

Conversation

IllianiBird
Copy link
Collaborator

Fix #6785

Dev Notes

As per rules as written contract negotiation uses the Negotiation skill of the negotiator. However, we were not verifying that the negotiator had the Negotiation skill before performing the check, resulting in an error.

### Dev Notes
As per rules as written contract negotiation uses the Negotiation skill of the negotiator. However, we were not verifying that the negotiator _had_ the Negotiation skill before performing the check, resulting in an error.
@IllianiBird IllianiBird added Bug AtB StratCon Bugs relating strictly to StratCon Severity: High Issues described as high severity as per the new issue form labels Apr 26, 2025
@IllianiBird IllianiBird self-assigned this Apr 26, 2025
@HammerGS HammerGS requested a review from Copilot April 26, 2025 20:47
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a null pointer exception in the contract negotiation flow by adding explicit null checks for the negotiator's negotiation skill before accessing its experience level.

  • Added static import for S_NEG for clarity.
  • Replaced chained null checks with explicit conditional statements for adminCommand, adminTransport, and adminLogistics.

Copy link
codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 20.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 11.45%. Comparing base (1e3b58e) to head (10985a2).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
...arket/contractMarket/AtbMonthlyContractMarket.java 20.00% 9 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             mas
8000
ter    #6786   +/-   ##
=========================================
  Coverage     11.45%   11.45%           
- Complexity     6501     6506    +5     
=========================================
  Files          1098     1098           
  Lines        140870   140875    +5     
  Branches      21843    21845    +2     
=========================================
+ Hits          16135    16144    +9     
+ Misses       123061   123057    -4     
  Partials       1674     1674           

☔ 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.

@HammerGS HammerGS merged commit aaf0dfc into MegaMek:master Apr 26, 2025
6 checks passed
@IllianiBird IllianiBird deleted the newContractNPEFix branch June 7, 2025 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AtB Bug Severity: High Issues described as high severity as per the new issue form StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GM Generate Contract Error
2 participants
0