# HG changeset patch # User tmolitor # Date 1503426358 -7200 # Node ID 9756211fcbe3cfa45e0d93d2af5848764a156b6d # Parent ff0495909d4ecb2ea7a7bd11eb9e670c811eb753 mod_cloud_notify: Fix small bug. See https://github.com/ChatSecure/ChatSecure-iOS/issues/770#issuecomment-323534057 for a description of the bug. diff -r ff0495909d4e -r 9756211fcbe3 mod_cloud_notify/mod_cloud_notify.lua --- a/mod_cloud_notify/mod_cloud_notify.lua Tue Aug 22 20:10:10 2017 +0200 +++ b/mod_cloud_notify/mod_cloud_notify.lua Tue Aug 22 20:25:58 2017 +0200 @@ -77,10 +77,12 @@ if push_errors[push_identifier] >= max_push_errors then module:log("warn", "Disabling push notifications for identifier '%s'", push_identifier); -- remove push settings from sessions - for _, session in pairs(host_sessions[node].sessions) do - if session.push_identifier == push_identifier then - session.push_identifier = nil; - session.push_settings = nil; + if host_sessions[node] then + for _, session in pairs(host_sessions[node].sessions) do + if session.push_identifier == push_identifier then + session.push_identifier = nil; + session.push_settings = nil; + end end end -- save changed global config