From a51587da480c7521b020e8de3834b61a0e7e2928 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 19 Mar 2021 19:07:25 +0100 Subject: util.datamapper: Only get element name if there's an element Fixes error due to attempting to index a nil value --- teal-src/util/datamapper.tl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'teal-src') 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 -- cgit v1.2.3