# HG changeset patch # User Kim Alvefur # Date 1638457720 -3600 # Node ID f74c7c518bb2800c7ed067545760542b455548ea # Parent 75543146e94e5b5d027faa9db46f0e320fd98848 mod_rest: Handle unknown 'kind' values Fixes error thrown by util.datamapper if the schema argument is nil diff -r 75543146e94e -r f74c7c518bb2 mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Sun Nov 28 21:30:53 2021 +0100 +++ b/mod_rest/jsonmap.lib.lua Thu Dec 02 16:08:40 2021 +0100 @@ -499,6 +499,9 @@ elseif kind == "iq" and not t_type then t_type = "get"; end + if not schema.properties[kind or "message"] then + return nil, "unknown-kind"; + end -- XEP-0313 conveninece mapping if kind == "iq" and t_type == "set" and type(t.archive) == "table" and not t.archive.form then