robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
122 stars 23 forks source link

NULL Pointer Exception running robocode-tankroyale-gui-0.14.2.jar in Java 18 Win 10 #38

Closed aurora126 closed 1 year ago

aurora126 commented 1 year ago

Describe the bug Running the latest 0.14.2 GUI Jar file produces an NULL Pointer exception.

To Reproduce Steps to reproduce the behavior:

  1. Download the robocode-tankroyale-gui-0.14.2.jar from the link in the latest releases page https://github.com/robocode-dev/tank-royale/releases.
  2. Open a windows 10 command prompt
  3. Type "java -jar robocode-tankroyale-gui-0.14.2.jar"
  4. See error

Error info C:\Robocode Tank Royale>java -jar robocode-tankroyale-gui-0.14.2.jar Exception in thread "main" java.lang.ExceptionInInitializerError at dev.robocode.tankroyale.gui.ui.control.ControlPanel.(Unknown Source) at dev.robocode.tankroyale.gui.ui.MainWindow$MainPanel.(Unknown Source) at dev.robocode.tankroyale.gui.ui.MainWindow.(Unknown Source) at dev.robocode.tankroyale.gui.GuiAppKt.main(Unknown Source) at dev.robocode.tankroyale.gui.GuiAppKt.main(Unknown Source) Caused by: java.lang.NullPointerException: must not be null at dev.robocode.tankroyale.gui.settings.ConfigSettings.getTps(Unknown Source) at dev.robocode.tankroyale.gui.ui.tps.TpsSlider.(Unknown Source) ... 5 more

Expected behavior A null pointer wasn't expected. I expected the GUI to open but it didn't.

Screenshots N/A

Desktop (please complete the following information):

Java info:

C:\Robocode Tank Royale>java -version java version "18.0.2" 2022-07-19 Java(TM) SE Runtime Environment (build 18.0.2+9-61) Java HotSpot(TM) 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing)

Additional context N/A

flemming-n-larsen commented 1 year ago

Thank you for taking your time to report this @aurora126. This helps a lot for reproducing the issue. šŸ™‚

I can confirm that this seems to be an issue that must be fixed asap!

flemming-n-larsen commented 1 year ago

A work-around is to create a file named config.properties beside the robocode-tankroyale-gui-0.14.2.jar with the following content:

tps=30
flemming-n-larsen commented 1 year ago

This issue should be fixed with release 0.14.3. šŸ™‚