mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
Add nullptr guard in record_runtime_stats_ for scheduler items
This commit is contained in:
@@ -521,6 +521,8 @@ WarnIfComponentBlockingGuard::warn_blocking(Component *component, uint32_t block
|
||||
|
||||
#ifdef USE_RUNTIME_STATS
|
||||
void WarnIfComponentBlockingGuard::record_runtime_stats_() {
|
||||
if (this->component_ == nullptr)
|
||||
return;
|
||||
uint32_t duration_us = micros() - this->started_us_;
|
||||
this->component_->runtime_stats_.record_time(duration_us);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user