[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Apr 28 07:05:13 UTC 2007


SVN commit 658697 by okellogg:

addNewItem(): Fix test for parentPkg==NULL.

 M  +7 -4      umllistview.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/umllistview.cpp #658696:658697
@@ -1819,10 +1819,6 @@
          parentItem = m_datatypeFolder;
      }
 
-    UMLPackage *parentPkg = dynamic_cast<UMLPackage*>(parentItem->getUMLObject());
-    if (parentPkg == NULL)
-        kError() << "UMLListView::addNewItem(type " << type
-            << "): parentPkg is NULL" << endl;
     UMLListViewItem * newItem = NULL;
     parentItem->setOpen( true );
 
@@ -1840,6 +1836,13 @@
                 << type << endl;
             return;
         }
+        UMLPackage *parentPkg =
+            dynamic_cast<UMLPackage*>(parentItem->getUMLObject());
+        if (parentPkg == NULL) {
+            kError() << "UMLListView::addNewItem(type " << type
+                << "): parentPkg is NULL" << endl;
+            return;
+        }
         if (Model_Utils::typeIsClassifierList(type)) {
             UMLClassifier *parent = static_cast<UMLClassifier*>(parentPkg);
             name = parent->uniqChildName(ot);




More information about the umbrello-devel mailing list