From d7b006600e76e5f6edb0c23b06daf867533ffdec Mon Sep 17 00:00:00 2001 From: Dale Higgs Date: Wed, 22 Jun 2016 10:54:44 -0500 Subject: [PATCH] [notify.pushover] Fix 'NoneType' error on data retrieval (#2352) * Fix 'NoneType' error on data retrieval * Reduce code for empty dict as the default --- homeassistant/components/notify/pushover.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/notify/pushover.py b/homeassistant/components/notify/pushover.py index 304d771f92a..a8bc3cf5179 100644 --- a/homeassistant/components/notify/pushover.py +++ b/homeassistant/components/notify/pushover.py @@ -51,10 +51,11 @@ class PushoverNotificationService(BaseNotificationService): """Send a message to a user.""" from pushover import RequestError - # Make a copy and use empty dict as default value (thanks @balloob) - data = dict(kwargs.get(ATTR_DATA, {})) + # Make a copy and use empty dict if necessary + data = dict(kwargs.get(ATTR_DATA) or {}) data['title'] = kwargs.get(ATTR_TITLE) + target = kwargs.get(ATTR_TARGET) if target is not None: data['device'] = target