Software /
code /
prosody
Comparison
util/datamapper.lua @ 11470:5ebad952ebf7
util.datamapper: Fix to skip parsing wrapped arrays that aren't there
Turns out the unreachable error is reachable :D
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 22 Mar 2021 10:03:32 +0100 |
parent | 11468:348b191cd850 |
child | 11471:ab03de8e503e |
comparison
equal
deleted
inserted
replaced
11469:087d710ed520 | 11470:5ebad952ebf7 |
---|---|
141 end | 141 end |
142 elseif value_where == "in_wrapper" and type(propschema) == "table" and proptype == "array" then | 142 elseif value_where == "in_wrapper" and type(propschema) == "table" and proptype == "array" then |
143 local wrapper = s:get_child(name, namespace); | 143 local wrapper = s:get_child(name, namespace); |
144 if wrapper then | 144 if wrapper then |
145 out[prop] = parse_array(propschema, wrapper); | 145 out[prop] = parse_array(propschema, wrapper); |
146 else | |
147 error("unreachable") | |
148 end | 146 end |
149 else | 147 else |
150 local value = extract_value(s, value_where, proptype, name, namespace, prefix, single_attribute, enums) | 148 local value = extract_value(s, value_where, proptype, name, namespace, prefix, single_attribute, enums) |
151 | 149 |
152 out[prop] = totype(proptype, value) | 150 out[prop] = totype(proptype, value) |