summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Eigensatz <[email protected]>2015-08-07 19:24:04 +0200
committerRalf Habacker <[email protected]>2015-08-07 20:56:15 +0200
commitd2daaa3bed35caa8beed9b87ccf647ff147bd25a (patch)
tree191b1e4dc36148e4fabcfdde23dd1f4729c5a6fa
parent7e3fbbd46a717f73fe0f4d511e4466b08f64625c (diff)
Coverity check CID 88355: NULL pointer check
In UMLListView::moveObject(*): Pointer is checked against null but then dereferenced anyway COVERITY:88355 CCBUG:340646 REVIEW:124654
-rw-r--r--umbrello/umllistview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/umbrello/umllistview.cpp b/umbrello/umllistview.cpp
index a798741..1745c10 100644
--- a/umbrello/umllistview.cpp
+++ b/umbrello/umllistview.cpp
@@ -1753,6 +1753,11 @@ UMLListViewItem * UMLListView::moveObject(Uml::ID::Type srcId, UMLListViewItem::
// update model objects
m_bCreatingChildObject = true;
+ if (!srcObj) {
+ uError() << "srcObj is NULL";
+ break;
+ }
+
UMLClassifier *oldParentClassifier = dynamic_cast<UMLClassifier*>(srcObj->parent());
UMLClassifier *newParentClassifier = dynamic_cast<UMLClassifier*>(newParentObj);
if (srcType == UMLListViewItem::lvt_Attribute) {