aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-22 10:03:32 +0100
committerKim Alvefur <zash@zash.se>2021-03-22 10:03:32 +0100
commitf68d29bafdfce1a5deff8608c543158a4524ae91 (patch)
treead1f8d020efeedc64a4938002bbab749b7a561fb
parent110e82bd93a475de96832ee6a0988fcc58378fe6 (diff)
downloadprosody-f68d29bafdfce1a5deff8608c543158a4524ae91.tar.gz
prosody-f68d29bafdfce1a5deff8608c543158a4524ae91.zip
util.datamapper: Fix to skip parsing wrapped arrays that aren't there
Turns out the unreachable error is reachable :D
-rw-r--r--teal-src/util/datamapper.tl2
-rw-r--r--util/datamapper.lua2
2 files changed, 0 insertions, 4 deletions
diff --git a/teal-src/util/datamapper.tl b/teal-src/util/datamapper.tl
index b94a1ace..1cc165e0 100644
--- a/teal-src/util/datamapper.tl
+++ b/teal-src/util/datamapper.tl
@@ -175,8 +175,6 @@ function parse_object (schema : schema_t, s : st.stanza_t) : { string : any }
local wrapper = s:get_child(name, namespace);
if wrapper then
out[prop] = parse_array(propschema, wrapper);
- else
- error "unreachable"
end
else
local value : string = extract_value (s, value_where, proptype, name, namespace, prefix, single_attribute, enums)
diff --git a/util/datamapper.lua b/util/datamapper.lua
index 65fa8e36..d989c75f 100644
--- a/util/datamapper.lua
+++ b/util/datamapper.lua
@@ -143,8 +143,6 @@ function parse_object(schema, s)
local wrapper = s:get_child(name, namespace);
if wrapper then
out[prop] = parse_array(propschema, wrapper);
- else
- error("unreachable")
end
else
local value = extract_value(s, value_where, proptype, name, namespace, prefix, single_attribute, enums)