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

This commit is contained in:
wmayer
2025-01-21 19:38:40 +01:00
committed by Ladislav Michl
parent 3129bc9a1e
commit 213c0940df

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;