Diff

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
line wrap: on
line diff
--- a/util/datamapper.lua	Fri Mar 19 15:51:38 2021 +0100
+++ b/util/datamapper.lua	Fri Mar 19 19:07:25 2021 +0100
@@ -105,7 +105,9 @@
 				else
 					c = s:get_child(nil, namespace);
 				end
-				value = c.name;
+				if type(c) == "table" then
+					value = c.name;
+				end
 			elseif value_where == "in_attribute" then
 				local attr = name
 				if prefix then