PD: handle null pointer in Feature::getBaseShape (#12385)

This commit is contained in:
Florian Foinant-Willig
2024-02-13 21:41:25 +01:00
committed by GitHub
parent 6fe05a9035
commit f9cebebd6b
2 changed files with 3 additions and 1 deletions

View File

@@ -156,6 +156,9 @@ Part::Feature* Feature::getBaseObject(bool silent) const {
const TopoDS_Shape& Feature::getBaseShape() const {
const Part::Feature* BaseObject = getBaseObject();
if (!BaseObject)
throw Base::ValueError("Base feature's shape is not defined");
if (BaseObject->isDerivedFrom(PartDesign::ShapeBinder::getClassTypeId())||
BaseObject->isDerivedFrom(PartDesign::SubShapeBinder::getClassTypeId()))
{

View File

@@ -328,4 +328,3 @@ TEST(Vector, TestAngleOriented)
}
// NOLINTEND