diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index c19caa1af9..f0e040f749 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1875,6 +1875,7 @@ Commander::run() const bool safety_updated = _safety_sub.updated(); if (safety_updated) { + const bool previous_safety_valid = (_safety.timestamp != 0); const bool previous_safety_off = _safety.safety_off; if (_safety_sub.copy(&_safety)) { @@ -1899,7 +1900,7 @@ Commander::run() } // Notify the user if the status of the safety switch changes - if (_safety.safety_switch_available && previous_safety_off != _safety.safety_off) { + if (previous_safety_valid && _safety.safety_switch_available && previous_safety_off != _safety.safety_off) { if (_safety.safety_off) { set_tune(tune_control_s::TUNE_ID_NOTIFY_POSITIVE);