MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 168 forks source link

[0.49.19] NPE "megamek.common.Entity.getEquipment(int)" is null #4074

Closed repligator closed 3 months ago

repligator commented 4 months ago

49.19, Linux, Java 17.0.10

Description

Attempted to start a battle. Triggers an NPE in Megamek (yes I know this is MekHQ and not MegaMek, but the issue seems to be MekHQ related, and the NPE popup said to post it here). Log and save file attached.

15:41:11,708 ERROR [mekhq.MekHQ] {Packet Pump} mekhq.MekHQ.lambda$main$0(MekHQ.java:242) - Uncaught Exception Detected java.lang.NullPointerException: Cannot invoke "megamek.common.Mounted.setNWeapons(int)" because the return value of "megamek.common.Entity.getEquipment(int)" is null at megamek.common.IAero.updateWeaponGroups(IAero.java:198) at megamek.server.GameManager.checkEntityExchange(GameManager.java:2235) at megamek.server.GameManager.executePhase(GameManager.java:2172) at megamek.server.GameManager.changePhase(GameManager.java:1609) at megamek.server.GameManager.endCurrentPhase(GameManager.java:2313) at megamek.server.GameManager.checkReady(GameManager.java:1392) at megamek.server.GameManager.handlePacket(GameManager.java:730) at megamek.server.Server.handle(Server.java:1277) at megamek.server.Server$PacketPump.run(Server.java:113) at java.base/java.lang.Thread.run(Thread.java:840)

WoB-V30731221.cpnx.gz megamek.log

repligator commented 4 months ago

I used GM mode to remove my only aero unit, (and added some others to friendly reinforcements for good measure). The mission launches fine now.

repligator commented 3 months ago

Working fine under the latest nightly, closing.