Guard against no content type (#7432)
This commit is contained in:
parent
dbd6f7e4ed
commit
c5a91393e4
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue