Core: GeoFeature::getPlacementFromProp prevent potential crash
This commit is contained in:
committed by
Chris Hennes
parent
ea08cb6776
commit
6e4d2a94d5
@@ -301,6 +301,10 @@ std::vector<Data::IndexedName> GeoFeature::getHigherElements(const char* element
|
||||
Base::Placement GeoFeature::getPlacementFromProp(App::DocumentObject* obj, const char* propName)
|
||||
{
|
||||
Base::Placement plc = Base::Placement();
|
||||
if (!obj) {
|
||||
return plc;
|
||||
}
|
||||
|
||||
auto* propPlacement = dynamic_cast<App::PropertyPlacement*>(obj->getPropertyByName(propName));
|
||||
if (propPlacement) {
|
||||
plc = propPlacement->getValue();
|
||||
@@ -381,3 +385,4 @@ Base::Placement GeoFeature::getGlobalPlacement(const DocumentObject* obj)
|
||||
|
||||
return placementProperty->getValue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user