From 846a0513c74b550b72bfe17d48959dc7defc3e97 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Fri, 10 Mar 2017 03:32:43 -0800 Subject: [PATCH] Don't allow sending to invalid iOS targets (#6115) * Don't allow sending to invalid targets * Fix valid target check --- homeassistant/components/notify/ios.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/notify/ios.py b/homeassistant/components/notify/ios.py index e788beda0c4..6486eed1512 100644 --- a/homeassistant/components/notify/ios.py +++ b/homeassistant/components/notify/ios.py @@ -84,6 +84,11 @@ class iOSNotificationService(BaseNotificationService): data[ATTR_DATA] = kwargs.get(ATTR_DATA) for target in targets: + if target not in ios.enabled_push_ids(): + _LOGGER.error("The target (%s) does not exist in ios.conf.", + targets) + return + data[ATTR_TARGET] = target req = requests.post(PUSH_URL, json=data, timeout=10)