From f29e7e67ba894676264221da4e1914f309c3969d Mon Sep 17 00:00:00 2001 From: ARMAR-6 <armar6@needs_you.com> Date: Tue, 2 May 2023 18:33:04 +0200 Subject: [PATCH] Add more sanity checks --- source/RobotAPI/components/ArViz/Client/Client.cpp | 2 ++ source/RobotAPI/components/ArViz/Client/Client.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/source/RobotAPI/components/ArViz/Client/Client.cpp b/source/RobotAPI/components/ArViz/Client/Client.cpp index 268da6274..36cfb2263 100644 --- a/source/RobotAPI/components/ArViz/Client/Client.cpp +++ b/source/RobotAPI/components/ArViz/Client/Client.cpp @@ -28,6 +28,7 @@ Client::Client(ManagedIceObject& obj, std::string const& storageName) { componentName = obj.getName(); + ARMARX_CHECK_NOT_EMPTY(componentName); obj.getTopic(topic, topicName); obj.getProxy(storage, storageName); } @@ -35,6 +36,7 @@ Client::Client(ManagedIceObject& obj, Client Client::createFromTopic(std::string const& componentName, Topic::ProxyType const& topic) { Client client; + ARMARX_CHECK_NOT_EMPTY(componentName); client.componentName = componentName; client.topic = topic; return client; diff --git a/source/RobotAPI/components/ArViz/Client/Client.h b/source/RobotAPI/components/ArViz/Client/Client.h index d05dc3980..a0b9c3944 100644 --- a/source/RobotAPI/components/ArViz/Client/Client.h +++ b/source/RobotAPI/components/ArViz/Client/Client.h @@ -132,6 +132,8 @@ namespace viz Layer layer(std::string const& name) const { + ARMARX_CHECK_NOT_EMPTY(componentName); + ARMARX_CHECK_NOT_EMPTY(name); return Layer(componentName, name); } -- GitLab