Skip to content

Commit

Permalink
Check that sources via UI is a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
crowbarz committed Apr 26, 2021
1 parent 4a6e19a commit 0cfb06f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/pioneer_async/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ async def async_step_init(self, user_input=None):
## Validate sources is a dict of names to numeric IDs
if CONF_SOURCES in options:
sources = json.loads(options[CONF_SOURCES])
if type(sources) is not dict:
raise Exception
for (source_name, source_id) in sources.items():
if not (
type(source_name) is str
Expand Down

0 comments on commit 0cfb06f

Please sign in to comment.