From 8409859e8df6e6c4883e2fda26fe69d21a2e8da1 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Thu, 9 Nov 2023 03:23:13 -0700 Subject: [PATCH] Implements safer way to use IfcCurveSegment.UsingCurves Co-authored-by: Thomas Krijnen --- src/ifcgeom/mapping/IfcCurveSegment.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ifcgeom/mapping/IfcCurveSegment.cpp b/src/ifcgeom/mapping/IfcCurveSegment.cpp index 05b9f5d538..4722621116 100644 --- a/src/ifcgeom/mapping/IfcCurveSegment.cpp +++ b/src/ifcgeom/mapping/IfcCurveSegment.cpp @@ -106,6 +106,7 @@ class segment_geometry_adjuster { // Get the parent of this segment. If it is a IfcGradientCurve or IfcSegmentedRefernceCurve // look for the optional EndPoint attribute auto curves = inst->UsingCurves(); +if (curves && curves->size() { auto curve = *curves->begin(); const IfcSchema::IfcPlacement* placement = nullptr; if (curve->as()) { @@ -118,6 +119,7 @@ class segment_geometry_adjuster { if (placement) { start_of_next_inst_ = taxonomy::cast(mapping->map(placement))->ccomponents(); } +} } }