Fix voice assistant crash when no speaker configured (#7075)

This commit is contained in:
kevdliu 2024-07-11 17:32:31 -04:00 committed by Jesse Hills
parent fbab0aceb0
commit c6c1d3a3ad
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -684,7 +684,9 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
this->defer([this, text]() { this->defer([this, text]() {
this->tts_start_trigger_->trigger(text); this->tts_start_trigger_->trigger(text);
#ifdef USE_SPEAKER #ifdef USE_SPEAKER
if (this->speaker_ != nullptr) {
this->speaker_->start(); this->speaker_->start();
}
#endif #endif
}); });
break; break;