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_stanza.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/xmpp/xmpp_stanza.hpp') diff --git a/src/xmpp/xmpp_stanza.hpp b/src/xmpp/xmpp_stanza.hpp index 9dee51f..476596b 100644 --- a/src/xmpp/xmpp_stanza.hpp +++ b/src/xmpp/xmpp_stanza.hpp @@ -77,7 +77,9 @@ public: XmlNode* add_child(XmlNode* child); XmlNode* add_child(XmlNode&& child); /** - * Returns the last of the children + * Returns the last of the children. If the node doesn't have any child, + * the behaviour is undefined. The user should make sure this is the case + * by calling has_children() for example. */ XmlNode* get_last_child() const; /** -- cgit v1.2.3