Salome HOME
fix for 7817: in removeArrayChild() the returned list of children of myArray is check...
authorasv <asv@opencascade.com>
Thu, 27 Jan 2005 08:34:19 +0000 (08:34 +0000)
committerasv <asv@opencascade.com>
Thu, 27 Jan 2005 08:34:19 +0000 (08:34 +0000)
src/SUPERVGUI/SUPERVGUI_Main.cxx

index 5b67e63e3d89ee137161cd3654716fbf6c7a7844..e7317460b29ac65c494ec039d415999c36315a4b 100644 (file)
@@ -1225,15 +1225,17 @@ void SUPERVGUI_Main::removeArrayChild(SUPERV::CNode_ptr theNode)
   // as argument
   if (myArray) {
     const QObjectList* aChList = myArray->children();
-    QObjectListIt aItChList(*aChList);
-    SUPERVGUI_CanvasNode* anObjNode;
-    while ((anObjNode = (SUPERVGUI_CanvasNode*)aItChList.current()) != 0) {
-      ++aItChList;
-      if ((QString(anObjNode->getEngine()->Name())).compare(QString(theNode->Name())) == 0) {
-       myArray->removeChild(anObjNode);
-       delete anObjNode;
+    if ( aChList ) { // asv 27.01.05 : fix for 7817
+      QObjectListIt aItChList(*aChList);
+      SUPERVGUI_CanvasNode* anObjNode;
+      while ((anObjNode = (SUPERVGUI_CanvasNode*)aItChList.current()) != 0) {
+       ++aItChList;
+       if ((QString(anObjNode->getEngine()->Name())).compare(QString(theNode->Name())) == 0) {
+         myArray->removeChild(anObjNode);
+         delete anObjNode;
+       }
       }
-    }
+    } // end of if ( ChList )
   }
 }