diff --git a/core/src/net/sf/openrocket/document/Simulation.java b/core/src/net/sf/openrocket/document/Simulation.java index 75f6cf0b2..fbba1e727 100644 --- a/core/src/net/sf/openrocket/document/Simulation.java +++ b/core/src/net/sf/openrocket/document/Simulation.java @@ -459,7 +459,7 @@ public class Simulation implements ChangeSource, Cloneable { /** * Return true if this simulation contains plottable flight data. * - * @return + * @return true if this simulation contains plottable flight data. */ public boolean hasSimulationData() { FlightData data = getSimulatedData(); @@ -471,6 +471,15 @@ public class Simulation implements ChangeSource, Cloneable { } return true; } + + /** + * Return true if this simulation contains summary flight data. + * @return true if this simulation contains summary flight data. + */ + public boolean hasSummaryData() { + FlightData data = getSimulatedData(); + return data != null; + } /** * Returns a copy of this simulation suitable for cut/copy/paste operations. diff --git a/swing/src/net/sf/openrocket/file/SimulationTableCSVExport.java b/swing/src/net/sf/openrocket/file/SimulationTableCSVExport.java index 0906b22ed..24f7f86d2 100644 --- a/swing/src/net/sf/openrocket/file/SimulationTableCSVExport.java +++ b/swing/src/net/sf/openrocket/file/SimulationTableCSVExport.java @@ -118,6 +118,11 @@ public class SimulationTableCSVExport { // Account for sorting... resulting CSV file will be in the same order as shown in the table thanks to this gem. int idx = simulationTable.convertRowIndexToModel(i); + // Ignore empty simulation + if (!document.getSimulation(idx).hasSummaryData()) { + continue; + } + int nullCnt = 0; rowColumnElement.clear();