Guard against no content type (#7432)
This commit is contained in:
1 parent
dbd6f7e4ed
commit
c5a91393e4
1 file changed
+3
-2
@@ -916,8 +916,9 @@ def _async_fetch_image(hass, url):
|
||||
|
||||
if response.status == 200:
|
||||
content = yield from response.read()
|
||||
content_type = response.headers.get(CONTENT_TYPE_HEADER)\
|
||||
.split(';')[0]
|
||||
content_type = response.headers.get(CONTENT_TYPE_HEADER)
|
||||
if content_type:
|
||||
content_type = content_type.split(';')[0]
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user