]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
0020867: EDF 1407 KERNEL: Error while saving study from script
authorvsr <vsr@opencascade.com>
Fri, 14 May 2010 16:12:22 +0000 (16:12 +0000)
committervsr <vsr@opencascade.com>
Fri, 14 May 2010 16:12:22 +0000 (16:12 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx

index b1020d2e8e2f75dde84ca98dc871b52696ca1544..b42685c3f828f079f66e1526716262db8168f3b6 100644 (file)
@@ -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;
     }