From 9e538806e7ebe712d2db8d19e7bce036b727a64b Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Thu, 16 Nov 2017 15:56:53 +0100
Subject: [PATCH] Fix construction of the graph (when there is only one node)

---
 src/graph/helper.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/graph/helper.cc b/src/graph/helper.cc
index 6c78d18..cbe0f3c 100644
--- a/src/graph/helper.cc
+++ b/src/graph/helper.cc
@@ -975,12 +975,12 @@ namespace hpp {
               const IndexV_t& idx_g, const IndexV_t& idx_oh,
               const GraspV_t& grasps, const int depth)
           {
-            if (idx_g.empty () || idx_oh.empty ()) return;
-            IndexV_t nIdx_g (idx_g.size() - 1);
-            IndexV_t nIdx_oh (idx_oh.size() - 1);
             bool curGraspIsAllowed = r.graspIsAllowed(grasps);
             if (curGraspIsAllowed) makeState (r, grasps, depth);
 
+            if (idx_g.empty () || idx_oh.empty ()) return;
+            IndexV_t nIdx_g (idx_g.size() - 1);
+            IndexV_t nIdx_oh (idx_oh.size() - 1);
             for (IndexV_t::const_iterator itx_g = idx_g.begin ();
                 itx_g != idx_g.end (); ++itx_g) {
               // Copy all element except itx_g
-- 
GitLab