Skip to content

Commit

Permalink
fix(helpers): fix key error during login exception
Browse files Browse the repository at this point in the history
Closes #423
  • Loading branch information
alandtse committed Oct 11, 2019
1 parent cf44ab8 commit ebda699
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/alexa_media/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ async def wrapper(*args, **kwargs) -> Any:
login = instance._login
email = login.email
hass = instance.hass if instance.hass else None
if (hass and not
(hass.data[DATA_ALEXAMEDIA]['accounts'][email]
['configurator'])):
if (hass and (
'configurator' not in (hass.data[DATA_ALEXAMEDIA]
['accounts'][email])
or not (hass.data[DATA_ALEXAMEDIA]['accounts'][email]
['configurator']))):
config_entry = (
hass.data[DATA_ALEXAMEDIA]
['accounts']
Expand Down

0 comments on commit ebda699

Please sign in to comment.