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

NPE on trying to save the campaign #5745

Open
5 tasks done
mjbroekman opened this issue Jan 10, 2025 · 1 comment
Open
5 tasks done

NPE on trying to save the campaign #5745

mjbroekman opened this issue Jan 10, 2025 · 1 comment
Labels
Severity: Critical Issues described as critical as per the new issue form

Comments

@mjbroekman
Copy link

mjbroekman commented Jan 10, 2025

Brief Description *

I just attempted to save the campaign and this popup showed up. I haven't seen this before and did not see any issues (open or closed) about it.
Screenshot 2025-01-10 at 10 30 26

3. Steps to Reproduce

After reloading my original save (30101202), I realized that there was a Special Mission that propagated. Prior to the crash, I did NOT realize that mission was there and had NOT allocated a unit to it until I advanced to the day of the mission and got the pop-up saying there was a mission that needed deployment.

I just loaded that save again, verified that the Special Mission was there, allocated a unit to it, advanced to the day of the mission and saved the game successfully.

I then tried to advance the day again (to get the pop-up about the scenario waiting for resolution), cancelled the dialog box and saved again without error.

Attach Files

customs.zip
Autosave-1-Logie's Hoagies-30101203.cpnx.gz
Autosave-1-Logie's Hoagies-30101204.cpnx.gz
Autosave-1-Logie's Hoagies-30101205.cpnx.gz
Autosave-1-Logie's Hoagies-30101206.cpnx.gz
Logie's Hoagies30101202.cpnx.gz
mekhq.log
megamek.log
megameklab.log

Severity *

Critical (Game-breaking/Crash): The game crashes or a core feature (like saving, loading, or network connection) is completely unusable.

MekHQ Suite Version *

0.50.02

Operating System *

MacOS 15.2

Java Version *

17.0.12

Final Verification

  • I confirm this is a single, unique issue that hasn't been reported before
  • I have filled and provided all necessary information above
  • I have included any and all logs, custom units, and CPNX (save) files
  • I have asked on MegaMek Discord about this issue
  • I have confirmed this issue is being opened on the correct repository: MegaMek, MegaMekLab, or MekHQ
@HammerGS HammerGS added the Severity: Critical Issues described as critical as per the new issue form label Jan 13, 2025
@HammerGS
Copy link
Member

From the MekHQ Logs.

09:21:57,537 ERROR [mekhq.service.AutosaveService] {AWT-EventQueue-0}
mekhq.service.AutosaveService.performAutosave(AutosaveService.java:98) - 
java.lang.NullPointerException: Cannot invoke "megamek.common.Entity.getShortNameRaw()" because "e" is null
	at mekhq.campaign.mission.Loot.writeToXML(Loot.java:327)
	at mekhq.campaign.mission.Scenario.writeToXMLBegin(Scenario.java:927)
	at mekhq.campaign.mission.Scenario.writeToXML(Scenario.java:874)
	at mekhq.campaign.mission.Mission.writeToXMLBegin(Mission.java:226)
	at mekhq.campaign.mission.Contract.writeToXMLBegin(Contract.java:702)
	at mekhq.campaign.mission.AtBContract.writeToXMLBegin(AtBContract.java:1109)
	at mekhq.campaign.mission.Mission.writeToXML(Mission.java:208)
	at mekhq.campaign.Campaign.writeToXML(Campaign.java:5687)
	at mekhq.service.AutosaveService.performAutosave(AutosaveService.java:91)
	at mekhq.service.AutosaveService.requestDayAdvanceAutosave(AutosaveService.java:61)
	at mekhq.campaign.Campaign.newDay(Campaign.java:4511)
	at mekhq.campaign.CampaignController.advanceDay(CampaignController.java:82)
	at mekhq.gui.CampaignGUI.lambda$initTopButtons$63(CampaignGUI.java:1168)
9:24:12,976 ERROR [mekhq.MekHQ] {AWT-EventQueue-0}
mekhq.MekHQ.lambda$main$1(MekHQ.java:296) - Uncaught java.lang.NullPointerException detected. Please open up an issue containing all logs, the game save file, and customs at https://github.com/MegaMek/megamek/issues . If Sentry is enabled, the error has also been logged.
java.lang.NullPointerException: Cannot invoke "megamek.common.Entity.getDisplayName()" because "entity" is null
	at mekhq.campaign.mission.Loot.getShortDescription(Loot.java:129)
	at mekhq.gui.view.AtBScenarioViewPanel.fillStats(AtBScenarioViewPanel.java:457)
	at mekhq.gui.view.AtBScenarioViewPanel.initComponents(AtBScenarioViewPanel.java:156)
	at mekhq.gui.view.AtBScenarioViewPanel.<init>(AtBScenarioViewPanel.java:137)
	at mekhq.gui.BriefingTab.refreshScenarioView(BriefingTab.java:1289)
	at mekhq.gui.BriefingTab.lambda$initTab$7(BriefingTab.java:225)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Critical Issues described as critical as per the new issue form
Projects
None yet
Development

No branches or pull requests

2 participants