mirror of
https://github.com/bjc/prosody.git
synced 2025-04-06 14:47:37 +03:00
tools/ejabberd2prosody: Don't throw an error if XML CDATA is null ([] in Erlang, instead of a string or being missing).
This commit is contained in:
parent
23a72948e9
commit
9b804fffc8
1 changed files with 4 additions and 2 deletions
|
@ -44,8 +44,10 @@ function build_stanza(tuple, stanza)
|
|||
for _, a in ipairs(tuple[4]) do build_stanza(a, stanza); end
|
||||
if up then stanza:up(); else return stanza end
|
||||
elseif tuple[1] == "xmlcdata" then
|
||||
assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2]));
|
||||
stanza:text(tuple[2]);
|
||||
if type(tuple[2]) ~= "table" then
|
||||
assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2]));
|
||||
stanza:text(tuple[2]);
|
||||
end -- else it's [], i.e., the null value, used for the empty string
|
||||
else
|
||||
error("unknown element type: "..serialize(tuple));
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue