From c7bd244010903ee3fa958655db5fef18104909c2 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 12 Dec 2008 08:44:42 +0000 Subject: [PATCH] Fix crash on open old files. --- src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index d662e03c7..64e73346a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -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); -- 2.39.2