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

Fix coverity CID 178697: Dereference after null check

Passing null pointer op to CmdRenameUMLObject, which dereferences it.

CCBUG:340646
parent 7bcc1be7
...@@ -514,7 +514,11 @@ void UMLListViewItem::slotEditFinished(const QString &newText) ...@@ -514,7 +514,11 @@ void UMLListViewItem::slotEditFinished(const QString &newText)
return; return;
} }
UMLOperation *op = m_object->asUMLOperation(); UMLOperation *op = m_object->asUMLOperation();
UMLClassifier *parent = op ? op->umlParent()->asUMLClassifier() : 0; if (!op) {
cancelRenameWithMsg();
return;
}
UMLClassifier *parent = op->umlParent()->asUMLClassifier();
Model_Utils::OpDescriptor od; Model_Utils::OpDescriptor od;
Model_Utils::Parse_Status st = Model_Utils::parseOperation(newText, od, parent); Model_Utils::Parse_Status st = Model_Utils::parseOperation(newText, od, parent);
if (st == Model_Utils::PS_OK) { if (st == Model_Utils::PS_OK) {
......
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