Measure: Fix crash in Measurement::length() when selecting infinite edge (e.g. PD datum line)

This commit is contained in:
wmayer
2025-08-25 09:21:33 +02:00
committed by Ladislav Michl
parent 04e9baf533
commit 2b2a82d901
+5 -2
View File
@@ -331,6 +331,9 @@ double Measurement::length() const
// Get the length of one edge
TopoDS_Shape shape = getShape(*obj, (*subEl).c_str(), TopAbs_EDGE);
if (shape.IsNull()) {
continue;
}
const TopoDS_Edge& edge = TopoDS::Edge(shape);
BRepAdaptor_Curve curve(edge);
@@ -365,8 +368,8 @@ double Measurement::length() const
throw Base::RuntimeError(
"Measurement - length - Curve type not currently handled");
}
} // end switch
} // end for
}
}
}
}
return result;