From a7c0a023987fe8a04cef052c68c507fb3c2f7d74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 22 Sep 2013 21:34:12 +0000 Subject: one more fix git-svn-id: http://svn.miranda-ng.org/main/trunk@6190 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_userinfo.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index d5fbce60c3..81b8a6d04d 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -362,23 +362,24 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM } // logoff - if (item->m_pItemResource->m_dwIdleStartTime > 0) { - lstrcpyn(buf, _tctime(&item->m_pItemResource->m_dwIdleStartTime), SIZEOF(buf)); - int len = lstrlen(buf); - if (len > 0) buf[len-1] = 0; - } - else if ( !item->m_pItemResource->m_dwIdleStartTime) - lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf)); - else - lstrcpyn(buf, TranslateT(""), SIZEOF(buf)); + if (item->m_pItemResource) { + if (item->m_pItemResource->m_dwIdleStartTime > 0) { + lstrcpyn(buf, _tctime(&item->m_pItemResource->m_dwIdleStartTime), SIZEOF(buf)); + int len = lstrlen(buf); + if (len > 0) buf[len-1] = 0; + } + else if ( !item->m_pItemResource->m_dwIdleStartTime) + lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf)); + else + lstrcpyn(buf, TranslateT(""), SIZEOF(buf)); - sttFillInfoLine(hwndTree, htiRoot, NULL, - (item->jid && _tcschr(item->jid, _T('@'))) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf, - sttInfoLineId(0, INFOLINE_LOGOFF)); + sttFillInfoLine(hwndTree, htiRoot, NULL, + (item->jid && _tcschr(item->jid, _T('@'))) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf, + sttInfoLineId(0, INFOLINE_LOGOFF)); - // logoff msg - sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Logoff message"), - item->m_pItemResource->m_tszStatusMessage ? item->m_pItemResource->m_tszStatusMessage : TranslateT(""), sttInfoLineId(0, INFOLINE_LOGOFF_MSG)); + sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Logoff message"), + item->m_pItemResource->m_tszStatusMessage ? item->m_pItemResource->m_tszStatusMessage : TranslateT(""), sttInfoLineId(0, INFOLINE_LOGOFF_MSG)); + } // activity if (item->m_pLastSeenResource) -- cgit v1.2.3