summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-15 00:47:20 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-15 00:47:20 +0200
commitdf765faab92f5fcbf05cc9316ba27b509158ce1c (patch)
tree0856fb574420ab3f898ce105f29e725ceda2b0c0 /src/xmpp/xmpp_component.cpp
parent7c7da2cedbd5701a849237f24407d5cb566db0b5 (diff)
downloadbiboumi-df765faab92f5fcbf05cc9316ba27b509158ce1c.tar.gz
biboumi-df765faab92f5fcbf05cc9316ba27b509158ce1c.tar.bz2
biboumi-df765faab92f5fcbf05cc9316ba27b509158ce1c.tar.xz
biboumi-df765faab92f5fcbf05cc9316ba27b509158ce1c.zip
Only call get_last_child() if the node has children
Explain that the behaviour is otherwise undefined, in the comment.
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp2
1 files changed, 1 insertions, 1 deletions
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())