[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

@ -92,6 +92,12 @@ class FlightDataHandler extends AbstractElementHandler {
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

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