Comparison

util/datamapper.lua @ 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
103 end 103 end
104 end 104 end
105 else 105 else
106 c = s:get_child(nil, namespace); 106 c = s:get_child(nil, namespace);
107 end 107 end
108 value = c.name; 108 if type(c) == "table" then
109 value = c.name;
110 end
109 elseif value_where == "in_attribute" then 111 elseif value_where == "in_attribute" then
110 local attr = name 112 local attr = name
111 if prefix then 113 if prefix then
112 attr = prefix .. ":" .. name 114 attr = prefix .. ":" .. name
113 elseif namespace ~= s.attr.xmlns then 115 elseif namespace ~= s.attr.xmlns then