--- a/core/xmlhandlers.lua Thu Feb 26 02:24:12 2009 +0000
+++ b/core/xmlhandlers.lua Thu Feb 26 02:26:30 2009 +0000
@@ -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 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();
+ end
end
end
return xml_handlers;