From bcaf345bec5950dd164f49765dc0487839b1fc3a Mon Sep 17 00:00:00 2001 From: SiboVG Date: Tue, 4 Apr 2023 14:14:41 +0200 Subject: [PATCH] Catch booster mount being null --- .../openrocket/file/rasaero/export/SimulationDTO.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/net/sf/openrocket/file/rasaero/export/SimulationDTO.java b/core/src/net/sf/openrocket/file/rasaero/export/SimulationDTO.java index f898722ec..a27ec07a5 100644 --- a/core/src/net/sf/openrocket/file/rasaero/export/SimulationDTO.java +++ b/core/src/net/sf/openrocket/file/rasaero/export/SimulationDTO.java @@ -240,10 +240,14 @@ public class SimulationDTO { calc = MassCalculator.calculateStructure(CGCalcConfig); // Get booster1 motor mass + double booster1MotorMass = 0; MotorMount booster1Mount = mounts.get((AxialStage) rocket.getChild(1)); - MotorConfiguration booster1Config = booster1Mount.getMotorConfig(fcid); - Motor booster1Motor = booster1Config.getMotor(); - double booster1MotorMass = booster1Motor != null ? booster1Motor.getLaunchMass() : 0; + Motor booster1Motor = null; + if (booster1Mount != null) { + MotorConfiguration booster1Config = booster1Mount.getMotorConfig(fcid); + booster1Motor = booster1Config.getMotor(); + booster1MotorMass = booster1Motor != null ? booster1Motor.getLaunchMass() : 0; + } // Set mass double booster2Mass = calc.getMass() + motorMass + sustainerMotorMass + booster1MotorMass;