mod_rest/jsonmap.lib.lua
changeset 3864 9752a6f1b9f3
parent 3863 da3a0f055526
child 3874 3261a82884bb
--- a/mod_rest/jsonmap.lib.lua	Sat Jan 25 02:03:30 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Sat Jan 25 02:06:07 2020 +0100
@@ -77,7 +77,7 @@
 			return { node = s.attr.node, identities = identities, features = features, };
 		end;
 		function  (s)
-			if type(s) == "table" then
+			if type(s) == "table" and s ~= json.null then
 				local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info", node = s.node });
 				if s.identities then
 					for _, identity in ipairs(s.identities) do
@@ -107,7 +107,7 @@
 		end;
 		function  (s)
 			local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#items" });
-			if type(s) == "table" then
+			if type(s) == "table" and s ~= json.null then
 				for _, item in ipairs(s) do
 					if type(item) == "string" then
 						disco:tag("item", { jid = item });