summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 142f0bc331..3f5496d145 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -182,14 +182,11 @@ int XmlGetChildInt(const TiXmlElement *hXml, const char *key)
const TiXmlElement* XmlGetChildByTag(const TiXmlElement *hXml, const char *key, const char *attrName, const char *attrValue)
{
- if (hXml == nullptr)
- return nullptr;
-
- auto *pChild = hXml->FirstChildElement(key);
- if (pChild == nullptr)
- return nullptr;
+ for (auto *pChild : TiXmlFilter(hXml, key))
+ if (pChild->Attribute(attrName, attrValue))
+ return pChild;
- return (pChild->Attribute(attrName, attrValue)) ? pChild : nullptr;
+ return nullptr;
}
int XmlGetChildCount(const TiXmlElement *hXml)