Added catching for no Paths in Dataset
This commit is contained in:
@@ -120,6 +120,7 @@ public class FlightRDController extends Controller {
|
|||||||
public void load() {
|
public void load() {
|
||||||
theDataSet = getParent().getCurrentDataset();
|
theDataSet = getParent().getCurrentDataset();
|
||||||
if (theDataSet != null) {
|
if (theDataSet != null) {
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
currentPathId = theDataSet.getFlightPaths().get(0).getID(); //Sets the default to the 1st Path
|
currentPathId = theDataSet.getFlightPaths().get(0).getID(); //Sets the default to the 1st Path
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
@@ -139,6 +140,9 @@ public class FlightRDController extends Controller {
|
|||||||
flightPaths = theDataSet.getFlightPaths();
|
flightPaths = theDataSet.getFlightPaths();
|
||||||
ArrayList<FlightPoint> flightPoints = flightPaths.get(0).getFlight();
|
ArrayList<FlightPoint> flightPoints = flightPaths.get(0).getFlight();
|
||||||
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
flightTableView.setItems(FXCollections.observableArrayList(flightPoints));
|
||||||
|
}catch(IndexOutOfBoundsException e){
|
||||||
|
System.out.println("There is no Paths to show");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user