From d688f387d71a3567242eb43bdac64c2c5266bba5 Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Wed, 12 Jan 2022 09:14:26 +0100
Subject: [PATCH] Arviz client: checking if topic and other proxies are not
 null

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

diff --git a/source/RobotAPI/components/ArViz/Client/Client.cpp b/source/RobotAPI/components/ArViz/Client/Client.cpp
index 3e6bcf38c..268da6274 100644
--- a/source/RobotAPI/components/ArViz/Client/Client.cpp
+++ b/source/RobotAPI/components/ArViz/Client/Client.cpp
@@ -71,6 +71,8 @@ Client Client::createForGuiPlugin(Component& component,
 CommitResult Client::commit(const StagedCommit& commit)
 {
     CommitResult result;
+
+    ARMARX_CHECK_NOT_NULL(storage);
     result.data_ = storage->commitAndReceiveInteractions(commit.data_);
     return result;
 }
@@ -78,6 +80,8 @@ CommitResult Client::commit(const StagedCommit& commit)
 CommitResultAsync Client::commitAsync(const StagedCommit& commit)
 {
     CommitResultAsync result;
+
+    ARMARX_CHECK_NOT_NULL(storage);
     result.async = storage->begin_commitAndReceiveInteractions(commit.data_);
     result.storage = storage;
     return result;
@@ -92,6 +96,7 @@ void Client::commit(const std::vector<Layer>& layers)
         updates.push_back(layer.data_);
     }
     // This commit call still uses the legacy topic API
+    ARMARX_CHECK_NOT_NULL(topic);
     topic->updateLayers(updates);
 }
 
-- 
GitLab