From 7219e3c8502692dd4aacac8f9bd640ae6717f32d Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 13 Apr 2013 13:09:40 +0000
Subject: [PATCH] fix crash

---
 Mesh/meshGRegionDelaunayInsertion.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Mesh/meshGRegionDelaunayInsertion.cpp b/Mesh/meshGRegionDelaunayInsertion.cpp
index da902af6ef..f7ebac6393 100644
--- a/Mesh/meshGRegionDelaunayInsertion.cpp
+++ b/Mesh/meshGRegionDelaunayInsertion.cpp
@@ -1150,10 +1150,11 @@ void insertVerticesInRegion (GRegion *gr)
       Msg::Debug("found %d tets with %d faces (%g sec for the classification)",
                  theRegion.size(), faces_bound.size(), _t2 - _t1);
       GRegion *myGRegion = getRegionFromBoundingFaces(gr->model(), faces_bound);
-      Msg::Info("Found region %d", myGRegion->tag());
-      if(myGRegion) // a geometrical region associated to the list of faces has been found
+      if(myGRegion){ // a geometrical region associated to the list of faces has been found
+        Msg::Info("Found region %d", myGRegion->tag());
         for(std::list<MTet4*>::iterator it2 = theRegion.begin();
             it2 != theRegion.end(); ++it2) (*it2)->setOnWhat(myGRegion);
+      }
       else // the tets are in the void
         for(std::list<MTet4*>::iterator it2 = theRegion.begin();
             it2 != theRegion.end(); ++it2)(*it2)->setDeleted(true);
-- 
GitLab