[fixes #1055] If no databranch in XML, data = null + status = NOT_SIMULATED

This commit is contained in:
Sibo Van Gool 2022-02-01 15:29:42 +01:00
parent cae5555139
commit e4d852e46f
2 changed files with 11 additions and 1 deletions

View File

@ -91,7 +91,13 @@ class FlightDataHandler extends AbstractElementHandler {
@Override
public void endHandler(String element, HashMap<String, String> attributes,
String content, WarningSet warnings) {
// If no <databranch> tag in XML, then there is no sim data
if (dataHandler == null) {
data = null;
return;
}
if (branches.size() > 0) {
data = new FlightData(branches.toArray(new FlightDataBranch[0]));
} else {

View File

@ -134,6 +134,10 @@ class SingleSimulationHandler extends AbstractElementHandler {
data = null;
else
data = dataHandler.getFlightData();
if (data == null) {
status = Status.NOT_SIMULATED;
}
Simulation simulation = new Simulation(doc.getRocket(), status, name,
options, extensions, data);