From f441336925314db813aa70e5879a46493ede10e5 Mon Sep 17 00:00:00 2001 From: asv Date: Thu, 27 Jan 2005 08:34:19 +0000 Subject: [PATCH] fix for 7817: in removeArrayChild() the returned list of children of myArray is checked for NULL. when no children exist, then it will be NULL and it was not checked. --- src/SUPERVGUI/SUPERVGUI_Main.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index 5b67e63..e731746 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -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 ) } } -- 2.30.2