diff --git a/src/Mod/Assembly/App/Constraint.cpp b/src/Mod/Assembly/App/Constraint.cpp index 0343a39f7..516f63246 100644 --- a/src/Mod/Assembly/App/Constraint.cpp +++ b/src/Mod/Assembly/App/Constraint.cpp @@ -56,6 +56,9 @@ using namespace Assembly; namespace Assembly { +struct ConstraintInitException : std::exception { + const char* what() const throw() { return "Constraint cout not be initialised: unsoported geometry";} +}; PROPERTY_SOURCE(Assembly::Constraint, App::DocumentObject) @@ -102,6 +105,9 @@ void Constraint::init(Assembly::ItemAssembly* ass) { m_first_geom = initLink(First); m_second_geom = initLink(Second); + + if(!m_first_geom || !m_second_geom) + throw ConstraintInitException(); } PyObject *Constraint::getPyObject(void)