# HG changeset patch # User Waqas Hussain # Date 1392757393 18000 # Node ID c352d97cf137e25d1d346e2876c5376406dd3cdc # Parent 93b4058e33203f69a2fe5299e8f224a64e083ec4 tools/ejabberd2prosody: Don't throw an error if XML CDATA is null ([] in Erlang, instead of a string or being missing). diff -r 93b4058e3320 -r c352d97cf137 tools/ejabberd2prosody.lua --- a/tools/ejabberd2prosody.lua Mon Feb 17 16:00:41 2014 -0500 +++ b/tools/ejabberd2prosody.lua Tue Feb 18 16:03:13 2014 -0500 @@ -44,8 +44,10 @@ 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