aboutsummaryrefslogtreecommitdiffstats
path: root/teal-src/util/datamapper.tl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-19 19:07:25 +0100
committerKim Alvefur <zash@zash.se>2021-03-19 19:07:25 +0100
commita51587da480c7521b020e8de3834b61a0e7e2928 (patch)
tree7d8b05a0b38eaf1f2e28b6971b4bf59f879bd454 /teal-src/util/datamapper.tl
parentf6de136dc4673d2977dbda10bba048a3012a004d (diff)
downloadprosody-a51587da480c7521b020e8de3834b61a0e7e2928.tar.gz
prosody-a51587da480c7521b020e8de3834b61a0e7e2928.zip
util.datamapper: Only get element name if there's an element
Fixes error due to attempting to index a nil value
Diffstat (limited to 'teal-src/util/datamapper.tl')
-rw-r--r--teal-src/util/datamapper.tl4
1 files changed, 3 insertions, 1 deletions
diff --git a/teal-src/util/datamapper.tl b/teal-src/util/datamapper.tl
index f0e7d6bc..3cbc7fda 100644
--- a/teal-src/util/datamapper.tl
+++ b/teal-src/util/datamapper.tl
@@ -138,7 +138,9 @@ function parse_object (schema : schema_t, s : st.stanza_t) : { string : any }
else
c = s:get_child(nil, namespace);
end
- value = c.name;
+ if c is st.stanza_t then
+ value = c.name;
+ end
elseif value_where == "in_attribute" then
local attr = name
if prefix then