From 8c44e831c6d299512d2e5eeb259bbc37bdf52751 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Thu, 13 Feb 2020 18:27:12 +0100
Subject: [PATCH] Fixed Config::printForDebug : if a stack element is out of
 bound, print ? instead

---
 reading_machine/src/Config.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/reading_machine/src/Config.cpp b/reading_machine/src/Config.cpp
index 3b6041b..faeb04f 100644
--- a/reading_machine/src/Config.cpp
+++ b/reading_machine/src/Config.cpp
@@ -136,7 +136,12 @@ void Config::printForDebug(FILE * dest) const
   for (auto & s : stack)
   {
     if (hasColIndex(idColName))
-      stackStr += getLastNotEmptyConst(idColName, s);
+    {
+      if (has(idColName, s, 0))
+        stackStr += getLastNotEmptyConst(idColName, s);
+      else
+        stackStr += "?";
+    }
     else
       stackStr += std::to_string(s);
     stackStr += ",";
-- 
GitLab