fix nullptr error

This commit is contained in:
Terrence
2025-04-09 08:24:02 +08:00
parent 9e0de3b302
commit 69540c6551
2 changed files with 6 additions and 2 deletions

View File

@@ -83,7 +83,9 @@ void WakeWordDetect::StartDetection() {
void WakeWordDetect::StopDetection() {
xEventGroupClearBits(event_group_, DETECTION_RUNNING_EVENT);
afe_iface_->reset_buffer(afe_data_);
if (afe_data_ != nullptr) {
afe_iface_->reset_buffer(afe_data_);
}
}
bool WakeWordDetect::IsDetectionRunning() {