Skip to content

Commit

Permalink
fix #962
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbrech committed Dec 22, 2023
1 parent 2b9d172 commit 5c645fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/guide_curves/CCPACSGuideCurves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ bool CCPACSGuideCurves::GuideCurveExists(std::string uid) const
std::vector<double> CCPACSGuideCurves::GetRelativeCircumferenceParameters() const
{
std::vector<double> relCircs;

// CPACS 3.3 requires guideCurves to be present. To prevent a hard crash if this is NOT the case,
// we shoud exit here (or at least before the call to relCircs.back())
if (GetGuideCurveCount() == 0) {
return relCircs;
}

for (int iguide = 1; iguide <= GetGuideCurveCount(); ++iguide) {
const CCPACSGuideCurve* root = GetGuideCurve(iguide).GetRootCurve();
relCircs.push_back(*root->GetFromRelativeCircumference_choice2());
Expand Down

0 comments on commit 5c645fc

Please sign in to comment.