tools/ejabberd2prosody.lua
changeset 6027 8c69cea8a1bf
parent 6007 ff24bc2d41a6
parent 6024 c352d97cf137
child 6284 b49540983320
--- a/tools/ejabberd2prosody.lua	Wed Feb 19 20:13:35 2014 +0100
+++ b/tools/ejabberd2prosody.lua	Wed Feb 26 22:21:55 2014 +0100
@@ -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