Skip to content

Commit

Permalink
Guard against no content type (#7432)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed May 4, 2017
1 parent dbd6f7e commit c5a9139
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/media_player/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5a9139

Please sign in to comment.