MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
297 stars 287 forks source link

Uncaught java.lang.NullPointException--no idea what caused it #6171

Closed nivenhuman closed 4 days ago

nivenhuman commented 5 days ago

Prerequisites and Pre-Issue Checklist

Severity *

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

Brief Description *

image I was playing against Princess when the game froze after ending physical combat phase and I got this popup. Here are the requested logs and game file. I was not using any custom units. Round-15-autosave_2024-11-02_18-12-34.sav.gz

Steps to Reproduce

Unclear what exactly triggered this.

Operating System *

Windows 10

Java Version *

17.0.12

MegaMek Suite Version *

v0.49.19.1

Custom MegaMek Version

No response

Attach Files

logs.zip

Final Checklist

kuronekochomusuke commented 4 days ago

18:14:35,872 ERROR [megamek.MegaMek] {Packet Pump} megamek.MegaMek.lambda$main$0(MegaMek.java:63) - Uncaught Exception Detected java.lang.ClassCastException: class megamek.common.MiscType cannot be cast to class megamek.common.AmmoType (megamek.common.MiscType and megamek.common.AmmoType are in unnamed module of loader 'app') at megamek.common.weapons.WeaponHandler.(WeaponHandler.java:1759) at megamek.common.weapons.infantry.InfantryWeaponHandler.(InfantryWeaponHandler.java:40) at megamek.common.weapons.infantry.InfantryWeapon.getCorrectHandler(InfantryWeapon.java:266) at megamek.common.weapons.Weapon.fire(Weapon.java:93) at megamek.server.GameManager.resolveOnlyWeaponAttacks(GameManager.java:14235) at megamek.server.GameManager.endCurrentPhase(GameManager.java:2423) at megamek.server.GameManager.changeToNextTurn(GameManager.java:2740) at megamek.server.GameManager.endCurrentTurn(GameManager.java:1587) at megamek.server.GameManager.receiveAttack(GameManager.java:13238) at megamek.server.GameManager.handlePacket(GameManager.java:771) at megamek.server.Server.handle(Server.java:1277) at megamek.server.Server$PacketPump.run(Server.java:113) at java.base/java.lang.Thread.run(Unknown Source)

18:14:39,904 ERROR [megamek.MegaMek] {AWT-EventQueue-0} megamek.MegaMek.lambda$main$0(MegaMek.java:63) - Uncaught Exception Detected java.lang.NullPointerException: Cannot invoke "megamek.common.Entity.getAlreadyTwisted()" because the return value of "megamek.client.ui.swing.FiringDisplay.ce()" is null at megamek.client.ui.swing.FiringDisplay.hexMoused(FiringDisplay.java:2129) at megamek.client.ui.swing.boardview.BoardView.processBoardViewEvent(BoardView.java:976) at megamek.client.ui.swing.boardview.BoardView.mouseAction(BoardView.java:4923) at megamek.client.ui.swing.boardview.BoardView.mouseAction(BoardView.java:4946) at megamek.client.ui.swing.boardview.BoardView.mousePressed(BoardView.java:4637) at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source) at java.desktop/java.awt.Component.processMouseEvent(Unknown Source) at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source) at java.desktop/java.awt.Component.processEvent(Unknown Source) at java.desktop/java.awt.Container.processEvent(Unknown Source) at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.Component.dispatchEvent(Unknown Source) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.Component.dispatchEvent(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.desktop/java.awt.EventQueue$4.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/java.awt.EventQueue$5.run(Unknown Source) at java.desktop/java.awt.EventQueue$5.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

kuronekochomusuke commented 4 days ago

fixed by #5573