From eea1c9abd5c0490421a6197a9ae53b92651d9c67 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Tue, 12 Nov 2024 03:29:32 -0800 Subject: [PATCH] check valid pointer (#2674) Signed-off-by: Ian Chen (cherry picked from commit 57599fb184090e11ed0cf58628a0327bb67a9f8d) --- src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc index c58740d1e1..b787444fa5 100644 --- a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc +++ b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc @@ -630,7 +630,7 @@ void OpticalTactilePluginPrivate::Enable(const gz::msgs::Boolean &_req) this->enabled = _req.data(); - if (!_req.data()) + if (!_req.data() && this->visualizePtr) { this->visualizePtr->RemoveNormalForcesAndContactsMarkers(); }