Fix bug when trying to remove station & none selected
This commit is contained in:
parent
306f169d08
commit
645b1f2414
@ -112,6 +112,9 @@ public class StationSelectionController {
|
|||||||
@FXML
|
@FXML
|
||||||
private void handleRemoveButtonPress(ActionEvent event) {
|
private void handleRemoveButtonPress(ActionEvent event) {
|
||||||
int selectedIndex = stationListView.getSelectionModel().getSelectedIndex();
|
int selectedIndex = stationListView.getSelectionModel().getSelectedIndex();
|
||||||
|
if (selectedIndex < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
StationSettings station = stationList.get(selectedIndex);
|
StationSettings station = stationList.get(selectedIndex);
|
||||||
String stationName = station.toString();
|
String stationName = station.toString();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user