From 941a59adb85b9c24efbb5b5a0131720b8771ed7f Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 14 Jul 2005 06:55:01 +0000 Subject: [PATCH] Fix for bug IPAL9222 : 3.0.0(/dn06/../current1506): SIGSEGV appears after trying to add an empty InLine node. --- src/SUPERVGUI/SUPERVGUI_Service.cxx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 0c9f542..11d0b8f 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -511,8 +511,9 @@ void SUPERVGUI_Service::addInlineNode() { switch (aSel) { case 0: // Computation { - SUPERV_CNode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(), - (myScriptPane->getFunction()).in()); + SUPERV_CNode aNode = + aMain->getDataflow()->INode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(), + (myScriptPane->getFunction()).in()); if (CORBA::is_nil(aNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; @@ -525,9 +526,10 @@ void SUPERVGUI_Service::addInlineNode() { case 1: // Switch { SUPERV_INode aEndNode; - SUPERV_CNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(), - (myScriptPane->getFunction()).in(), - aEndNode); + SUPERV_CNode aStartNode = + aMain->getDataflow()->SNode(myScriptPane->getFuncName().isEmpty() ? "" : myScriptPane->getFuncName().latin1(), + (myScriptPane->getFunction()).in(), + aEndNode); if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; @@ -539,10 +541,14 @@ void SUPERVGUI_Service::addInlineNode() { case 2: // Loop { SUPERV_INode aEndNode; - SUPERV_CNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(), - myMorePane->getFuncName().latin1(), (myMorePane->getFunction()).in(), - myNextPane->getFuncName().latin1(), (myNextPane->getFunction()).in(), - aEndNode); + SUPERV_CNode aStartNode = + aMain->getDataflow()->LNode(myInitPane->getFuncName().isEmpty() ? "" : myInitPane->getFuncName().latin1(), + (myInitPane->getFunction()).in(), + myMorePane->getFuncName().isEmpty() ? "" : myMorePane->getFuncName().latin1(), + (myMorePane->getFunction()).in(), + myNextPane->getFuncName().isEmpty() ? "" : myNextPane->getFuncName().latin1(), + (myNextPane->getFunction()).in(), + aEndNode); if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; -- 2.39.2