diff --git a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc index d6e3abef64..f374e04218 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(); }