[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-11 07:24:32 +13:00
committed by Jesse Hills
co-authored by Claude Opus 4.5
parent eea7e9edff
commit 9eee4c9924
+4
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() {