mod_snikket_ios_preserve_push: Handle case where user has no push registrations stored
This commit is contained in:
parent
e125e70e3e
commit
1fe4571ab4
|
@ -11,6 +11,7 @@ module:hook("resource-bind", function (event)
|
||||||
local client_id = session.client_id;
|
local client_id = session.client_id;
|
||||||
if not client_id then return; end
|
if not client_id then return; end
|
||||||
local push_registrations = push_store:get(session.username);
|
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
|
for push_identifier, push_registration in pairs(push_registrations) do
|
||||||
if push_registration.client_id == client_id then
|
if push_registration.client_id == client_id then
|
||||||
session.push_identifier = push_identifier;
|
session.push_identifier = push_identifier;
|
||||||
|
|
Loading…
Reference in New Issue