Avoid SMESH module GUI loading failure

This commit is contained in:
jfa 2005-03-28 14:26:59 +00:00
parent 304f30c5ca
commit b864c4bb3b

View File

@ -103,7 +103,9 @@ void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
void SMESH_Gen_i::AddToCurrentPyScript (const TCollection_AsciiString& theString)
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
aSMESHGen->AddToPythonScript(aSMESHGen->GetCurrentStudy()->StudyId(), theString);
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
if (aStudy->_is_nil()) return;
aSMESHGen->AddToPythonScript(aStudy->StudyId(), theString);
}