From f5a8a82ab0b5d45775c1e119a8c775c4f9a7dfac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Sep 2014 19:34:52 +0000 Subject: tabSRMM not to crash on non-existent contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@10560 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/contactcache.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'plugins/TabSRMM/src/contactcache.cpp') diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 93fbca70d0..53ef5a3884 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -45,15 +45,16 @@ CContactCache::CContactCache(const MCONTACT hContact) m_wOldStatus = m_wStatus = ID_STATUS_OFFLINE; if (hContact) { - cc = db_get_contact(hContact); - initPhaseTwo(); - } - else { - cc = &ccInvalid; - m_szAccount = C_INVALID_ACCOUNT; - m_isMeta = false; - m_Valid = false; + if ((cc = db_get_contact(hContact)) != NULL) { + initPhaseTwo(); + return; + } } + + cc = &ccInvalid; + m_szAccount = C_INVALID_ACCOUNT; + m_isMeta = false; + m_Valid = false; } /** -- cgit v1.2.3