Diff

core/xmlhandlers.lua @ 862:b3b80ccddb0c

Merged with main tip.
author Tobias Markmann <tm@ayena.de>
date Tue, 03 Mar 2009 17:48:04 +0100
parent 844:503ca8da1000
child 896:2c0b9e3c11c3
line wrap: on
line diff
--- a/core/xmlhandlers.lua	Sun Feb 22 20:57:57 2009 +0100
+++ b/core/xmlhandlers.lua	Tue Mar 03 17:48:04 2009 +0100
@@ -121,17 +121,19 @@
 					cb_error(session, "parse-error", "unexpected-element-close", name);
 				end
 			end
-			if stanza and #chardata > 0 then
-				-- We have some character data in the buffer
-				stanza:text(t_concat(chardata));
-				chardata = {};
-			end
-			-- Complete stanza
-			if #stanza.last_add == 0 then
-				cb_handlestanza(session, stanza);
-				stanza = nil;
-			else
-				stanza:up();
+			if stanza then
+				if #chardata > 0 then
+					-- We have some character data in the buffer
+					stanza:text(t_concat(chardata));
+					chardata = {};
+				end
+				-- Complete stanza
+				if #stanza.last_add == 0 then
+					cb_handlestanza(session, stanza);
+					stanza = nil;
+				else
+					stanza:up();
+				end
 			end
 		end
 	return xml_handlers;