Skip to content

Commit

Permalink
Check sensor connection thread validity before joining (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombrodie authored Dec 16, 2024
1 parent c6f66d2 commit 0469977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/os_sensor_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ void OusterSensor::start_sensor_connection_thread() {

void OusterSensor::stop_sensor_connection_thread() {
NODELET_DEBUG("sensor_connection_thread stopping.");
if (sensor_connection_thread->joinable()) {
if ((sensor_connection_thread != nullptr) && sensor_connection_thread->joinable()) {
sensor_connection_active = false;
sensor_connection_thread->join();
}
Expand Down

0 comments on commit 0469977

Please sign in to comment.