From b3c0964aa16905d911f619eb3f13b7dbed94e235 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 15 May 2009 07:51:33 +0500 Subject: xmlhandlers: Removed another unnecessary check --- core/xmlhandlers.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua index fc070115..573a9604 100644 --- a/core/xmlhandlers.lua +++ b/core/xmlhandlers.lua @@ -120,19 +120,17 @@ function init_xmlhandlers(session, stream_callbacks) cb_error(session, "parse-error", "unexpected-element-close", name); end end - 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 + 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 return xml_handlers; -- cgit v1.2.3