wpilibsuite / PathWeaver

Desktop application for generating motion paths
Other
64 stars 68 forks source link

Fix NPE when launching with corrupt preferences #278

Closed rzblue closed 1 year ago

rzblue commented 1 year ago

When launching with corrupt preferences, ProgramPreferences opens a new Alert to alert the user. It also applies dark mode with FxUtils.applyDarkMode(), which accesses PathWeaver.mainScene, which hasn't been initialized yet (ProgramPreferences is first called during WelcomeController.initialize()). This causes a NullPointerException

Removing the call to applyDarkMode() fixes this, and doesn't affect behavior since the program launches in light mode anyway.