1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00

[core] Add capacity check to register_component_ (#13778)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jonathan Swoboda
2026-02-05 09:00:16 -05:00
committed by GitHub
parent f4e410f47f
commit 081f953dc3

View File

@@ -81,6 +81,10 @@ void Application::register_component_(Component *comp) {
return;
}
}
if (this->components_.size() >= ESPHOME_COMPONENT_COUNT) {
ESP_LOGE(TAG, "Cannot register component %s - at capacity!", LOG_STR_ARG(comp->get_component_log_str()));
return;
}
this->components_.push_back(comp);
}
void Application::setup() {