Catch booster mount being null
This commit is contained in:
parent
485c23161e
commit
bcaf345bec
@ -240,10 +240,14 @@ public class SimulationDTO {
|
|||||||
calc = MassCalculator.calculateStructure(CGCalcConfig);
|
calc = MassCalculator.calculateStructure(CGCalcConfig);
|
||||||
|
|
||||||
// Get booster1 motor mass
|
// Get booster1 motor mass
|
||||||
|
double booster1MotorMass = 0;
|
||||||
MotorMount booster1Mount = mounts.get((AxialStage) rocket.getChild(1));
|
MotorMount booster1Mount = mounts.get((AxialStage) rocket.getChild(1));
|
||||||
MotorConfiguration booster1Config = booster1Mount.getMotorConfig(fcid);
|
Motor booster1Motor = null;
|
||||||
Motor booster1Motor = booster1Config.getMotor();
|
if (booster1Mount != null) {
|
||||||
double booster1MotorMass = booster1Motor != null ? booster1Motor.getLaunchMass() : 0;
|
MotorConfiguration booster1Config = booster1Mount.getMotorConfig(fcid);
|
||||||
|
booster1Motor = booster1Config.getMotor();
|
||||||
|
booster1MotorMass = booster1Motor != null ? booster1Motor.getLaunchMass() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Set mass
|
// Set mass
|
||||||
double booster2Mass = calc.getMass() + motorMass + sustainerMotorMass + booster1MotorMass;
|
double booster2Mass = calc.getMass() + motorMass + sustainerMotorMass + booster1MotorMass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user