]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug12202
authorapo <apo@opencascade.com>
Tue, 2 May 2006 12:09:55 +0000 (12:09 +0000)
committerapo <apo@opencascade.com>
Tue, 2 May 2006 12:09:55 +0000 (12:09 +0000)
TC: CRASH after import of "test18.med" file in MESH module.

src/CONVERTOR/VISU_MedConvertor.cxx

index a83cb552db7af83f8481c266241e414f7cedd481..9f678c4e03d34f623adf74b1fba8103d8e64b883 100644 (file)
@@ -1112,36 +1112,38 @@ VISU_MedConvertor
       aMesh->myMeshInfo = aMeshInfo;
       aMesh->myNamedPointCoords(new TMEDNamedPointCoords());
       
+      INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
+             "; aDim = "<<aDim<<"\n");
+
       if(aType == MED::eNON_STRUCTURE){
 
-       MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
-      
-       MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+       if(MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo)){
+         MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
 
-       aMesh->myNbPoints = aNodeInfo->GetNbElem();
-       aMesh->myEntityInfo = anEntityInfo;
+         aMesh->myNbPoints = aNodeInfo->GetNbElem();
+         aMesh->myEntityInfo = anEntityInfo;
        
-       INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
-               "'; myNbPoints = "<<aMesh->myNbPoints<<
-               "; aDim = "<<aDim<<"\n");
        
 #ifndef _DEXCEPT_
-       try{
+         try{
 #endif
-         BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
-         
-         BuildMeshOnEntityMap(aMesh,
-                              anEntityInfo,
-                              aNodeInfo,
+           INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
+                   "; anEntityInfo.size() = "<<anEntityInfo.size()<<
+                   "\n");
+           
+           BuildMeshOnEntityMap(aMesh,
+                                anEntityInfo,
+                                aNodeInfo,
                               aMed);
-         
+           
 #ifndef _DEXCEPT_
-       }catch(std::exception& exc){
-         MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
-       }catch(...){
-         MSG(MYDEBUG,"Unknown exception !!!");
-       }
+         }catch(std::exception& exc){
+           MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+         }catch(...){
+           MSG(MYDEBUG,"Unknown exception !!!");
+         }
 #endif
+       }
       } // NON STRUCTURED MESH
       else {
        MED::PGrilleInfo aGrilleInfo = aMed->GetPGrilleInfo(aMeshInfo);