From fec1080c53bb892c7e101a159c472ecd447d06fd Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 14 May 2010 16:12:22 +0000 Subject: [PATCH] 0020867: EDF 1407 KERNEL: Error while saving study from script --- src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index b1020d2e8..b42685c3f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -320,6 +320,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, char aMultifileState[2]; char ASCIIfileState[2]; + bool hasModuleData = false; try { std::string scoid = anSCO.GetID(); hdf_file->OpenOnDisk(HDF_RDONLY); @@ -327,6 +328,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, hdf_group->OpenOnDisk(); HDFgroup *hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group); hdf_sco_group->OpenOnDisk(); + hasModuleData = true; unsigned char* aStreamFile = NULL; int aStreamSize = 0; @@ -397,6 +399,10 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, } if (aLocked) _study->GetProperties()->SetLocked(true); + + if (!hasModuleData) + return true; + _errorCode = "No persistent file"; return false; } -- 2.39.2