From 8955f0e5c3c236dd5b38f8ba3628f31cce798299 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 23 Jul 2013 18:25:34 +0000 Subject: crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@5459 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_util.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 2abab23957..7f3a953551 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -931,15 +931,17 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen) TCHAR *p = _tcschr(dest, '/'); JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, jid); - if (LI && LI->resourceCount == 1 && !lstrcmp(LI->pResources->szCapsNode, _T("http://talk.google.com/xmpp/bot/caps"))) { - if (p) *p = 0; - return dest; - } + if (LI != NULL) { + if (LI->resourceCount == 1 && !lstrcmp(LI->pResources->szCapsNode, _T("http://talk.google.com/xmpp/bot/caps"))) { + if (p) *p = 0; + return dest; + } - if (p == NULL) { - JABBER_RESOURCE_STATUS *r = LI->getBestResource(); - if (r != NULL) - mir_sntprintf(dest, destLen, _T("%s/%s"), jid, r->resourceName); + if (p == NULL) { + JABBER_RESOURCE_STATUS *r = LI->getBestResource(); + if (r != NULL) + mir_sntprintf(dest, destLen, _T("%s/%s"), jid, r->resourceName); + } } return dest; -- cgit v1.2.3