Skip to content

Commit

Permalink
Merge pull request #178 from custom-components/Check-coordinator-data…
Browse files Browse the repository at this point in the history
…-before-accessing-it

Check coordinator data before accessing it
  • Loading branch information
isabellaalstrom authored Jan 26, 2022
2 parents 0a00bb2 + 8384ba0 commit d0e530b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/grocy/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def entity_registry_enabled_default(self) -> bool:
@property
def entity_data(self):
"""Return the entity_data of the entity."""
if self.coordinator.data is None:
return None
return self.coordinator.data.get(self.entity_type)

@property
Expand Down

0 comments on commit d0e530b

Please sign in to comment.