mirror of
https://github.com/esphome/esphome.git
synced 2025-10-25 05:03:52 +01:00
nullptr
This commit is contained in:
@@ -289,6 +289,9 @@ class Scheduler {
|
|||||||
SchedulerItem::Type type, bool match_retry) {
|
SchedulerItem::Type type, bool match_retry) {
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
for (auto &item : container) {
|
for (auto &item : container) {
|
||||||
|
// Skip nullptr items (can happen in defer_queue_ when items are being processed)
|
||||||
|
if (!item)
|
||||||
|
continue;
|
||||||
if (this->matches_item_(item, component, name_cstr, type, match_retry)) {
|
if (this->matches_item_(item, component, name_cstr, type, match_retry)) {
|
||||||
// Mark item for removal (platform-specific)
|
// Mark item for removal (platform-specific)
|
||||||
#ifdef ESPHOME_THREAD_MULTI_ATOMICS
|
#ifdef ESPHOME_THREAD_MULTI_ATOMICS
|
||||||
@@ -311,6 +314,9 @@ class Scheduler {
|
|||||||
bool has_cancelled_timeout_in_container_(const Container &container, Component *component, const char *name_cstr,
|
bool has_cancelled_timeout_in_container_(const Container &container, Component *component, const char *name_cstr,
|
||||||
bool match_retry) const {
|
bool match_retry) const {
|
||||||
for (const auto &item : container) {
|
for (const auto &item : container) {
|
||||||
|
// Skip nullptr items (can happen in defer_queue_ when items are being processed)
|
||||||
|
if (!item)
|
||||||
|
continue;
|
||||||
if (is_item_removed_(item.get()) &&
|
if (is_item_removed_(item.get()) &&
|
||||||
this->matches_item_(item, component, name_cstr, SchedulerItem::TIMEOUT, match_retry,
|
this->matches_item_(item, component, name_cstr, SchedulerItem::TIMEOUT, match_retry,
|
||||||
/* skip_removed= */ false)) {
|
/* skip_removed= */ false)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user