Salome HOME
Fix crash on open old files. BR_DumpPython_Extension TG_DumpPython_Extension_4
authorrnv <rnv@opencascade.com>
Fri, 12 Dec 2008 08:44:42 +0000 (08:44 +0000)
committerrnv <rnv@opencascade.com>
Fri, 12 Dec 2008 08:44:42 +0000 (08:44 +0000)
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx

index d662e03c7a2bff029eb6fdd458b93c8a123104fb..64e73346a72a5e92533f3e52ee3bfa7c79abb5f2 100644 (file)
@@ -187,10 +187,12 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl)
       return NULL;
     }
 
-  //Read and create notebook variables
-  hdf_notebook_vars  = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file);
-  ReadNoteBookVariables(Study,hdf_notebook_vars);
-  hdf_notebook_vars =0; //will be deleted by hdf_sco_group destructor
+  //Read and create notebook variables 
+  if(hdf_file->ExistInternalObject("NOTEBOOK_VARIABLES")) {
+    hdf_notebook_vars  = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file);
+    ReadNoteBookVariables(Study,hdf_notebook_vars);
+    hdf_notebook_vars =0; //will be deleted by hdf_sco_group destructor
+  }
 
   hdf_file->CloseOnDisk();
   hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);