summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_rc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-19 01:13:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-19 19:24:16 +0300
commitc9e483e0fb1566d210530339d13a0e6e91260200 (patch)
tree92e35cfeef803235fdad89b69968d4b6fd64abdf /protocols/JabberG/src/jabber_rc.cpp
parentaf9bb538a0609893db7d5f2582595660395f0821 (diff)
more checks for GetText()
Diffstat (limited to 'protocols/JabberG/src/jabber_rc.cpp')
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 26e3b801b4..272f5b7c06 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -341,10 +341,11 @@ int CJabberProto::AdhocSetStatusHandler(const TiXmlElement*, CJabberIqInfo *pInf
if (!fieldNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- const char *pszValue = fieldNode->FirstChildElement("value")->GetText();
- if (pszValue == nullptr)
+ auto *nodeValue = fieldNode->FirstChildElement("value");
+ if (nodeValue == nullptr)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
+ const char *pszValue = nodeValue->GetText();
int status;
if (!mir_strcmp(pszValue, "away")) status = ID_STATUS_AWAY;
else if (!mir_strcmp(pszValue, "xa")) status = ID_STATUS_NA;