From b2ca86d8d72b636011a73394bf9bcdedb3b109b7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 26 Feb 2021 08:11:16 +0100 Subject: [PATCH] FEM: [skip ci] fix crash in Constraint::getDirection --- src/Mod/Fem/App/FemConstraint.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 4e77962533..18f72e87d2 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -432,6 +432,10 @@ Base::Vector3d Constraint::getBasePoint(const Base::Vector3d& base, const Base:: const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direction) { App::DocumentObject* obj = direction.getValue(); + if (!obj) { + return Base::Vector3d(0,0,0); + } + if (obj->getTypeId().isDerivedFrom(App::Line::getClassTypeId())) { Base::Vector3d vec(1.0, 0.0, 0.0); static_cast(obj)->Placement.getValue().multVec(vec, vec);