From c5a91393e4203a76b62fe95ca1986115475c50f9 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 3 May 2017 20:12:51 -0700 Subject: [PATCH] Guard against no content type (#7432) --- homeassistant/components/media_player/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index a633a58912b..97712e1c0ad 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -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