From b864c4bb3b5a558a0f4848c88b27b5e72ccdd852 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 28 Mar 2005 14:26:59 +0000 Subject: [PATCH] Avoid SMESH module GUI loading failure --- src/SMESH_I/SMESH_Gen_i_DumpPython.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/SMESH_Gen_i_DumpPython.cxx b/src/SMESH_I/SMESH_Gen_i_DumpPython.cxx index adfb83764..9e5f3ed9f 100644 --- a/src/SMESH_I/SMESH_Gen_i_DumpPython.cxx +++ b/src/SMESH_I/SMESH_Gen_i_DumpPython.cxx @@ -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); } -- 2.39.2