diff --git a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc index a6e2fec324..7763769c84 100644 --- a/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc +++ b/src/systems/optical_tactile_plugin/OpticalTactilePlugin.cc @@ -631,7 +631,7 @@ void OpticalTactilePluginPrivate::Enable(const ignition::msgs::Boolean &_req) this->enabled = _req.data(); - if (!_req.data()) + if (!_req.data() && this->visualizePtr) { this->visualizePtr->RemoveNormalForcesAndContactsMarkers(); }