[fixes #1055] If no databranch in XML, data = null + status = NOT_SIMULATED
This commit is contained in:
parent
cae5555139
commit
e4d852e46f
@ -91,7 +91,13 @@ class FlightDataHandler extends AbstractElementHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void endHandler(String element, HashMap<String, String> attributes,
|
public void endHandler(String element, HashMap<String, String> attributes,
|
||||||
String content, WarningSet warnings) {
|
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) {
|
if (branches.size() > 0) {
|
||||||
data = new FlightData(branches.toArray(new FlightDataBranch[0]));
|
data = new FlightData(branches.toArray(new FlightDataBranch[0]));
|
||||||
} else {
|
} else {
|
||||||
|
@ -134,6 +134,10 @@ class SingleSimulationHandler extends AbstractElementHandler {
|
|||||||
data = null;
|
data = null;
|
||||||
else
|
else
|
||||||
data = dataHandler.getFlightData();
|
data = dataHandler.getFlightData();
|
||||||
|
|
||||||
|
if (data == null) {
|
||||||
|
status = Status.NOT_SIMULATED;
|
||||||
|
}
|
||||||
|
|
||||||
Simulation simulation = new Simulation(doc.getRocket(), status, name,
|
Simulation simulation = new Simulation(doc.getRocket(), status, name,
|
||||||
options, extensions, data);
|
options, extensions, data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user