Fix bug when selected station doesn't exist

This commit is contained in:
Nathan McRae 2025-02-08 17:12:05 -08:00
parent 741055b200
commit 00832e92bf

View File

@ -171,8 +171,12 @@ public class MainController implements Initializable {
.findFirst()
.orElse(null);
// TODO: if there are no stations, then create a default station and select that
if (selectedStation == null) {
// TODO: create a new station and save it?
logger.log(Level.SEVERE, "Selected station '" + selectedStationName.get() + "' not found");
selectedStation = settings.getStations().get(0);
selectedStationName.set(selectedStation.getName());
}
messageTextArea.addEventFilter(KeyEvent.ANY, event -> {