Measure: Fix crash in Measurement::length() when selecting infinite edge (e.g. PD datum line)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user