Commit ed05f534 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix possible crash

parent d5500e2c
...@@ -103,8 +103,8 @@ UMLObject* findObjectInList(Uml::ID::Type id, const UMLObjectList& inList) ...@@ -103,8 +103,8 @@ UMLObject* findObjectInList(Uml::ID::Type id, const UMLObjectList& inList)
case UMLObject::ot_Enum: case UMLObject::ot_Enum:
case UMLObject::ot_Entity: case UMLObject::ot_Entity:
case UMLObject::ot_Instance: case UMLObject::ot_Instance:
o = obj->asUMLClassifier()->findChildObjectById(id); o = obj->isUMLClassifier() ? obj->asUMLClassifier()->findChildObjectById(id) : nullptr;
if (o == 0 && if (o == nullptr &&
(t == UMLObject::ot_Interface || t == UMLObject::ot_Class)) (t == UMLObject::ot_Interface || t == UMLObject::ot_Class))
o = ((UMLPackage*)obj)->findObjectById(id); o = ((UMLPackage*)obj)->findObjectById(id);
if (o) if (o)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment