From df765faab92f5fcbf05cc9316ba27b509158ce1c Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 15 May 2014 00:47:20 +0200 Subject: Only call get_last_child() if the node has children Explain that the behaviour is otherwise undefined, in the comment. --- src/xmpp/xmpp_component.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xmpp/xmpp_component.cpp') diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index f6e1ddb..32f5d96 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -380,7 +380,7 @@ void XmppComponent::handle_message(const Stanza& stanza) // We consider this to be true, unless the error condition is // specified and is not in the kickable_errors set bool kickable_error = true; - if (error) + if (error && error->has_children()) { const XmlNode* condition = error->get_last_child(); if (kickable_errors.find(condition->get_name()) == kickable_errors.end()) -- cgit v1.2.3