From 4be568a775a7d43ae4438e05fcb889477c2ff570 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 23 Nov 2012 13:28:41 +0000 Subject: [PATCH] Do not crash if there is no document in Activity: create a new document with ID "-1" on check-in --- src/SALOMEDSImpl/SALOMEDSImpl_SimanStudy.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SimanStudy.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SimanStudy.cxx index a925f1127..b8eb4795c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SimanStudy.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SimanStudy.cxx @@ -77,7 +77,7 @@ SALOMEDSImpl_SimanStudy::~SALOMEDSImpl_SimanStudy() SALOMEDS::ListOfFileNames aTmpFiles; aTmpFiles.length(1); aTmpFiles[0] = aFileName.c_str(); - // try to removetemporary directory that contains this file if directory becomes empty + // try to remove temporary directory that contains this file if directory becomes empty SALOMEDS_Tool::RemoveTemporaryFiles(aDir, aTmpFiles, true); } } @@ -180,7 +180,9 @@ void SALOMEDSImpl_SimanStudy::CheckIn(const std::string theModuleName) if (CORBA::is_nil(aComp)) { MESSAGE("Checkin: component "<getModifiedData(_study->StudyId()); int aNumData = aList->length(); for(int aDataIndex = 0; aDataIndex < aNumData; aDataIndex++) { @@ -229,8 +231,9 @@ void SALOMEDSImpl_SimanStudy::CheckIn(const std::string theModuleName) SALOMEDS::ListOfFileNames aTmpFiles; aTmpFiles.length(aTemporaryFileNames.size()); list::iterator aFilesIter = aTemporaryFileNames.begin(); - for(int a = 0; aFilesIter != aTemporaryFileNames.end(); aFilesIter++, a++) + for(int a = 0; aFilesIter != aTemporaryFileNames.end(); aFilesIter++, a++) { aTmpFiles[a] = aFilesIter->c_str(); + } SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aTmpFiles, true); } else { MESSAGE("There is no connection to SIMAN!") -- 2.39.2