Use entry.data.get() in forked_daapd config_flow as some entries miss… (#37359)

This commit is contained in:
uvjustin 2020-07-03 01:51:13 +08:00 committed by GitHub
parent e60b975b10
commit 49bbdb3c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,7 +133,7 @@ class ForkedDaapdFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
if user_input is not None:
# check for any entries with same host, abort if found
for entry in self._async_current_entries():
if entry.data[CONF_HOST] == user_input[CONF_HOST]:
if entry.data.get(CONF_HOST) == user_input[CONF_HOST]:
return self.async_abort(reason="already_configured")
validate_result = await self.validate_input(user_input)
if validate_result[0] == "ok": # success