# HG changeset patch # User Kim Alvefur # Date 1579914367 -3600 # Node ID 9752a6f1b9f3a65672559b36162ee2d14422b7a9 # Parent da3a0f05552626639fdc5a733639f2448520f1b5 mod_rest: Avoid treating special json.null value as any other table diff -r da3a0f055526 -r 9752a6f1b9f3 mod_rest/jsonmap.lib.lua --- 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 });