Do not call component update on failed components (#1392)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Alex 2021-05-04 21:31:38 -05:00 committed by GitHub
parent 28ed42d879
commit b103be99e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -266,7 +266,11 @@ template<typename... Ts> class UpdateComponentAction : public Action<Ts...> {
public:
UpdateComponentAction(PollingComponent *component) : component_(component) {}
void play(Ts... x) override { this->component_->update(); }
void play(Ts... x) override {
if (this->component_->is_failed())
return;
this->component_->update();
}
protected:
PollingComponent *component_;