mirror of
https://github.com/esphome/esphome.git
synced 2026-09-13 08:17:34 +00:00
[voice_assistant][micro_wake_word] Fix null deref and missing error return (#14906)
This commit is contained in:
@@ -80,6 +80,7 @@ bool StreamingModel::load_model_() {
|
||||
TfLiteTensor *output = this->interpreter_->output(0);
|
||||
if ((output->dims->size != 2) || (output->dims->data[0] != 1) || (output->dims->data[1] != 1)) {
|
||||
ESP_LOGE(TAG, "Streaming model tensor output dimension is not 1x1.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (output->type != kTfLiteUInt8) {
|
||||
|
||||
@@ -619,6 +619,8 @@ void VoiceAssistant::start_playback_timeout_() {
|
||||
this->cancel_timeout("speaker-timeout");
|
||||
this->set_state_(State::RESPONSE_FINISHED, State::RESPONSE_FINISHED);
|
||||
|
||||
if (this->api_client_ == nullptr)
|
||||
return;
|
||||
api::VoiceAssistantAnnounceFinished msg;
|
||||
msg.success = true;
|
||||
this->api_client_->send_message(msg);
|
||||
|
||||
Reference in New Issue
Block a user