From d543ea641ddda1280c41bc7a8316d03c475bf7b0 Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Wed, 3 May 2023 09:15:36 +0200
Subject: [PATCH] ArViz: discarding layer updates if component name is empty

---
 source/RobotAPI/components/ArViz/ArVizStorage.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/source/RobotAPI/components/ArViz/ArVizStorage.cpp b/source/RobotAPI/components/ArViz/ArVizStorage.cpp
index 261ac386d..01ebcf74c 100644
--- a/source/RobotAPI/components/ArViz/ArVizStorage.cpp
+++ b/source/RobotAPI/components/ArViz/ArVizStorage.cpp
@@ -22,6 +22,7 @@
 
 #include "ArVizStorage.h"
 
+#include <ArmarXCore/core/logging/Logging.h>
 #include <ArmarXCore/core/util/IceBlobToObject.h>
 #include <ArmarXCore/core/util/ObjectToIceBlob.h>
 #include <ArmarXCore/core/system/ArmarXDataPath.h>
@@ -143,6 +144,12 @@ namespace armarx
             historyEntry.timestampInMicroseconds = nowInMicroSeconds;
             historyEntry.update = update;
 
+            if(update.component.empty())
+            {
+                ARMARX_WARNING << deactivateSpam(10) << "Empty `component` in ArViz update! Discarding update. Check your code ...";
+                continue;
+            }
+
             // Insert or create the layer
             bool found = false;
             for (auto& layer : currentState)
-- 
GitLab