jonathanabennett / megastrike

Megastrike is a port of the Alpha Strike board game to Computer in the same Spirit as MegaMek.
Other
1 stars 0 forks source link

NPE When attempting to load a scenario #13

Open repligator opened 3 days ago

repligator commented 3 days ago

Describe the bug An NPE is thrown when attempting to load a scenario. The forces and units associated with that scenario do not appear in the lobby.

To Reproduce Press Load Scenario Select a Scenario

Expected behavior The lobby to be populated by the forces and units associated with that scenario.

Screenshots Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "s" is null at clojure.string$trim.invokeStatic(string.clj:239) at clojure.string$trim.invoke(string.clj:235) at megastrike.utils$keyword_maker.invokeStatic(utils.clj:43) at megastrike.utils$keyword_maker.invoke(utils.clj:37) at megastrike.scenario$configure_unit.invokeStatic(scenario.clj:60) at megastrike.scenario$configure_unit.invoke(scenario.clj:46) at megastrike.scenario$parse_line.invokeStatic(scenario.clj:85) at megastrike.scenario$parse_line.invoke(scenario.clj:72) at megastrike.scenario$parse_scenario_file.invokeStatic(scenario.clj:141) at megastrike.scenario$parse_scenario_file.invoke(scenario.clj:135) at megastrike.scenario$setup_scenario.invokeStatic(scenario.clj:146) at megastrike.scenario$setup_scenario.invoke(scenario.clj:144) at megastrike.gui.lobby.events$fn__3182.invokeStatic(events.clj:34) at megastrike.gui.lobby.events$fn__3182.invoke(events.clj:27) at clojure.lang.MultiFn.invoke(MultiFn.java:229) at cljfx.event_handler$wrap_co_effects$fn__2379.invoke(event_handler.clj:10) at cljfx.event_handler$wrap_effects$dispatch_sync_BANG___2392.invoke(event_handler.clj:27) at cljfx.event_handler$wrap_effects$dispatch_sync_BANG___2392.invoke(event_handler.clj:25) at cljfx.lifecycle$make_handler_fn$fn__2051.invoke(lifecycle.clj:131) at cljfx.coerce$event_handler$reify__1657.handle(coerce.clj:135) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Node.fireEvent(Node.java:8923) at javafx.scene.control.Button.fire(Button.java:203) at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207) at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.event.Event.fireEvent(Event.java:198) at javafx.scene.Scene$MouseHandler.process(Scene.java:3894) at javafx.scene.Scene.processMouseEvent(Scene.java:1887) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2620) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450) at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449) at com.sun.glass.ui.View.handleMouseEvent(View.java:551) at com.sun.glass.ui.View.notifyMouse(View.java:937) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316) at java.base/java.lang.Thread.run(Thread.java:840)

Desktop (please complete the following information): Linux Java 17

jonathanabennett commented 3 days ago

Can you tell me which scenario you've tried it on?

jonathanabennett commented 3 days ago

@repligator This should be fixed in 122b438. But I am going to use this issue to track other issues with scenarios (full crashes and bad loads).

I will make a 0.2.1 release shortly which incorporates the fix after I've documented all the longer term issues and fixed any quick fixes I can find.

jonathanabennett commented 3 days ago

The rest of the scenarios were able to load correctly after a few minor changes which will be the next release.

jonathanabennett commented 3 days ago

Original bug fixed in v0.2.1

repligator commented 2 days ago

Scenarios now load correctly (at least for me).

jonathanabennett commented 1 day ago

Fixed in 0.3.0, which should be ready for release