Skip to content

Commit

Permalink
Fix ImpactCB parameter exception
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Dec 10, 2023
1 parent 156d550 commit 662ba87
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/CC_RP0/Parameter/ImpactCBParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ protected override void OnParameterSave(ConfigNode node)
base.OnParameterSave(node);

node.AddValue("minSrfVel", minSrfVel);
node.AddValue("targetBody", targetBody.name);
if (targetBody != null) // to prevent an exception being thrown due to a mistake that made it into previous release
{
node.AddValue("targetBody", targetBody.name);
}
}

protected override void OnParameterLoad(ConfigNode node)
{
base.OnParameterLoad(node);

minSrfVel = ConfigNodeUtil.ParseNode<double>(node, "minSrfVel");
minSrfVel = ConfigNodeUtil.ParseValue<double>(node, "minSrfVel");
targetBody = ConfigNodeUtil.ParseValue<CelestialBody>(node, "targetBody", null);
}

Expand Down

0 comments on commit 662ba87

Please sign in to comment.