mod_snikket_ios_preserve_push: Handle case where user has no push registrations stored

This commit is contained in:
Matthew Wild 2021-11-01 10:16:08 +00:00
parent e125e70e3e
commit 1fe4571ab4
1 changed files with 1 additions and 0 deletions

View File

@ -11,6 +11,7 @@ module:hook("resource-bind", function (event)
local client_id = session.client_id;
if not client_id then return; end
local push_registrations = push_store:get(session.username);
if not push_registrations then return; end
for push_identifier, push_registration in pairs(push_registrations) do
if push_registration.client_id == client_id then
session.push_identifier = push_identifier;