mod_cloud_notify: Fix small bug.
See https://github.com/ChatSecure/ChatSecure-iOS/issues/770#issuecomment-323534057 for
a description of the bug.
--- 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