From dce24205f83064f8ad895bd93af6801965ee7a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sun, 13 Aug 2017 09:59:57 +0200 Subject: [PATCH 1/2] fix issue #8948 in pushbullet --- homeassistant/components/notify/pushbullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/notify/pushbullet.py b/homeassistant/components/notify/pushbullet.py index f3bb5a119d0a7a..7e4901f94ac019 100644 --- a/homeassistant/components/notify/pushbullet.py +++ b/homeassistant/components/notify/pushbullet.py @@ -91,7 +91,7 @@ def send_message(self, message=None, **kwargs): # Backward compatibility, notify all devices in own account if url: self.pushbullet.push_link(title, url, body=message) - if self.hass.config.is_allowed_path(filepath): + if filepath and self.hass.config.is_allowed_path(filepath): with open(filepath, "rb") as fileh: filedata = self.pushbullet.upload_file(fileh, filepath) self.pushbullet.push_file(title=title, body=message, From bb49d76eefcf713e5465cf4052ee9ebb753946ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sun, 13 Aug 2017 20:44:02 +0200 Subject: [PATCH 2/2] pushbullet --- homeassistant/components/notify/pushbullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/notify/pushbullet.py b/homeassistant/components/notify/pushbullet.py index 7e4901f94ac019..8ac2bd06dad01f 100644 --- a/homeassistant/components/notify/pushbullet.py +++ b/homeassistant/components/notify/pushbullet.py @@ -115,7 +115,7 @@ def send_message(self, message=None, **kwargs): if url: self.pushbullet.push_link( title, url, body=message, email=tname) - if self.hass.config.is_allowed_path(filepath): + if filepath and self.hass.config.is_allowed_path(filepath): with open(filepath, "rb") as fileh: filedata = self.pushbullet.upload_file(fileh, filepath) self.pushbullet.push_file(title=title, body=message,