mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Guard against no content type (#7432)
This commit is contained in:
parent
dbd6f7e4ed
commit
c5a91393e4
@ -916,8 +916,9 @@ def _async_fetch_image(hass, url):
|
|||||||
|
|
||||||
if response.status == 200:
|
if response.status == 200:
|
||||||
content = yield from response.read()
|
content = yield from response.read()
|
||||||
content_type = response.headers.get(CONTENT_TYPE_HEADER)\
|
content_type = response.headers.get(CONTENT_TYPE_HEADER)
|
||||||
.split(';')[0]
|
if content_type:
|
||||||
|
content_type = content_type.split(';')[0]
|
||||||
|
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user