From 9e6efccfc82648f079a5730dfcf38540349d1ead Mon Sep 17 00:00:00 2001
From: "Christian R. G. Dreher" <c.dreher@kit.edu>
Date: Thu, 14 Jan 2021 14:23:35 +0100
Subject: [PATCH] fix: Ensure stack is not empty before calling top.

---
 .../libraries/armem/component/RemoteGuiAronDataVisitor.h     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/source/RobotAPI/libraries/armem/component/RemoteGuiAronDataVisitor.h b/source/RobotAPI/libraries/armem/component/RemoteGuiAronDataVisitor.h
index c009416a7..ebc924ba0 100644
--- a/source/RobotAPI/libraries/armem/component/RemoteGuiAronDataVisitor.h
+++ b/source/RobotAPI/libraries/armem/component/RemoteGuiAronDataVisitor.h
@@ -96,7 +96,10 @@ namespace armarx::armem
         template <class Navigator>
         void addValueLabel(Navigator& n, const std::string& typeName)
         {
-            groups.top().addChild(Label(this->makeValueLabelText(n, typeName)));
+            if (not groups.empty())
+            {
+                groups.top().addChild(Label(this->makeValueLabelText(n, typeName)));
+            }
         }
         template <class Navigator>
         std::string makeValueLabelText(Navigator& n, const std::string& typeName)
-- 
GitLab