Comparison

teal-src/util/datamapper.tl @ 11464:6e25409fecbd

util.datamapper: Only get element name if there's an element Fixes error due to attempting to index a nil value
author Kim Alvefur <zash@zash.se>
date Fri, 19 Mar 2021 19:07:25 +0100
parent 11462:d1982b7eb00d
child 11465:19a88b61ab4e
comparison
equal deleted inserted replaced
11463:21523e3d395e 11464:6e25409fecbd
136 if c then break end 136 if c then break end
137 end 137 end
138 else 138 else
139 c = s:get_child(nil, namespace); 139 c = s:get_child(nil, namespace);
140 end 140 end
141 value = c.name; 141 if c is st.stanza_t then
142 value = c.name;
143 end
142 elseif value_where == "in_attribute" then 144 elseif value_where == "in_attribute" then
143 local attr = name 145 local attr = name
144 if prefix then 146 if prefix then
145 attr = prefix .. ':' .. name 147 attr = prefix .. ':' .. name
146 elseif namespace ~= s.attr.xmlns then 148 elseif namespace ~= s.attr.xmlns then