aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-02-26 22:21:55 +0100
committerKim Alvefur <zash@zash.se>2014-02-26 22:21:55 +0100
commit42c4183e34f2a15920d3df042eed5531b552c495 (patch)
treeace5cad832311d8026958763adde400641650098 /tools
parent0213c9ded3d5be56806a5e9e528f61bc37331997 (diff)
parent4ee0ced8eb75a28f30744f18694ca1fab670bea0 (diff)
downloadprosody-42c4183e34f2a15920d3df042eed5531b552c495.tar.gz
prosody-42c4183e34f2a15920d3df042eed5531b552c495.zip
Merge 0.9->0.10
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ejabberd2prosody.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index e9dbd2dc..66bf4f93 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -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