diff mod_push2/mod_push2.lua @ 5845:83ee752f148c

mod_push2: empty table instead of nil when not present
author Stephen Paul Weber <singpolyma@singpolyma.net>
date Sun, 25 Feb 2024 19:10:30 -0500
parents 4b052598e435
children
line wrap: on
line diff
--- a/mod_push2/mod_push2.lua	Sun Feb 25 15:28:45 2024 +0000
+++ b/mod_push2/mod_push2.lua	Sun Feb 25 19:10:30 2024 -0500
@@ -536,7 +536,7 @@
 
 	-- only notify if the stanza destination is the mam user we store it for
 	if event.for_user == to then
-		local user_push_services = push2_registrations:get(to)
+		local user_push_services = push2_registrations:get(to) or {}
 
 		-- Urgent stanzas are time-sensitive (e.g. calls) and should
 		-- be pushed immediately to avoid getting stuck in the smacks