Commit 7bcc1be7 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix coverity CID 178698: Unchecked dynamic_cast

Passing null pointer pConcept to findChildObject, which dereferences it.

parent fc461345
......@@ -48,8 +48,8 @@ bool UMLInstanceAttributeDialog::apply()
i18n("Value Invalid"), 0);
return false;
UMLClassifier * pConcept = dynamic_cast<UMLClassifier *>(m_pAttribute->parent());
UMLObject *o = pConcept->findChildObject(name);
UMLClassifier * pConcept = m_pAttribute->umlParent()->asUMLClassifier();
UMLObject *o = pConcept ? pConcept->findChildObject(name) : 0;
if (o && o != m_pAttribute) {
KMessageBox::error(this, i18n("The attribute name you have chosen is already being used in this operation."),
i18n("Attribute Name Not Unique"), 0);
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