1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

Fix scheduler crash when cancelling items with NULL names (#9444)

This commit is contained in:
J. Nick Koston
2025-07-11 09:11:45 -10:00
committed by GitHub
parent 475fe60f27
commit bef20b60d0
4 changed files with 111 additions and 15 deletions

View File

@@ -150,9 +150,6 @@ class Scheduler {
return is_static_string ? static_cast<const char *>(name_ptr) : static_cast<const std::string *>(name_ptr)->c_str();
}
// Helper to check if a name is valid (not null and not empty)
inline bool is_name_valid_(const char *name) { return name != nullptr && name[0] != '\0'; }
// Common implementation for cancel operations
bool cancel_item_(Component *component, bool is_static_string, const void *name_ptr, SchedulerItem::Type type);