From 5c645fcdf3f9e3f8b21c71b076d59810670ae28a Mon Sep 17 00:00:00 2001 From: Jan Kleinert Date: Fri, 15 Dec 2023 15:09:21 +0100 Subject: [PATCH] fix #962 --- src/guide_curves/CCPACSGuideCurves.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/guide_curves/CCPACSGuideCurves.cpp b/src/guide_curves/CCPACSGuideCurves.cpp index ad9f765dc..630a453ec 100644 --- a/src/guide_curves/CCPACSGuideCurves.cpp +++ b/src/guide_curves/CCPACSGuideCurves.cpp @@ -97,6 +97,13 @@ bool CCPACSGuideCurves::GuideCurveExists(std::string uid) const std::vector CCPACSGuideCurves::GetRelativeCircumferenceParameters() const { std::vector 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());