Fix IllegalStateException when export/print
Correct the logic for detecting if a motor has an invalid FlightConfigurationId and throw an IllegalStateException only in the case that it has an error. Additionally, fix the lookup for the stageMass. The wrong value was passed to the MassCalculator.getCGAnalysis(..) which resulted in a NullPointerException. Fixes #531 Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
This commit is contained in:
parent
dee887479d
commit
6dae530acc
@ -328,7 +328,7 @@ public class DesignReport {
|
||||
|
||||
MassCalculator massCalc = new MassCalculator();
|
||||
|
||||
if( !motorId.hasError() ){
|
||||
if( motorId.hasError() ){
|
||||
throw new IllegalStateException("Attempted to add motor data with an invalid fcid");
|
||||
}
|
||||
rocket.createFlightConfiguration(motorId);
|
||||
@ -349,7 +349,7 @@ public class DesignReport {
|
||||
config.clearAllStages();
|
||||
config.setOnlyStage(stage);
|
||||
stage++;
|
||||
stageMass = massCalc.getCGAnalysis( config).get(stage).weight;
|
||||
stageMass = massCalc.getCGAnalysis(config).get(c).weight;
|
||||
// Calculate total thrust-to-weight from only lowest stage motors
|
||||
totalTTW = 0;
|
||||
topBorder = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user