From c42db4838123bf2daa68db33ab0274d83e32316b Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 9 Apr 2014 11:56:22 +0000
Subject: [PATCH] small fixes

---
 Mesh/DivideAndConquer.cpp | 1 +
 Mesh/Field.cpp            | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Mesh/DivideAndConquer.cpp b/Mesh/DivideAndConquer.cpp
index 183da42e30..d23a3c773f 100644
--- a/Mesh/DivideAndConquer.cpp
+++ b/Mesh/DivideAndConquer.cpp
@@ -535,6 +535,7 @@ void DocRecord::voronoiCell(PointNumero pt, std::vector<SPoint2> &pts) const
 {
   if (!_adjacencies){
     Msg::Error("No adjacencies were created");
+    return;
   }
   const int n = _adjacencies[pt].t_length;
   for(int j = 0; j < n; j++) {
diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp
index 6b55d146de..f6f5f3c19f 100644
--- a/Mesh/Field.cpp
+++ b/Mesh/Field.cpp
@@ -1246,8 +1246,11 @@ class PostViewField : public Field
     // of finding an element
     if(!octree->searchTensorWithTol(x, y, z, l, 0, 0, 0.05))
       Msg::Info("No tensor element found containing point (%g,%g,%g)", x, y, z);
-    if(l <= 0 && crop_negative_values)
-      for(int i = 0; i < 9; i++) l[i] = MAX_LC;
+    if(crop_negative_values){
+      for(int i = 0; i < 9; i++){
+        if(l[i] <= 0) l[i] = MAX_LC;
+      }
+    }
     metr(0, 0) = l[0];
     metr(0, 1) = l[1];
     metr(0, 2) = l[2];
-- 
GitLab