diff options
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 3 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistsettings.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/clistsettings.cpp | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index d63ead4360..c60058c1bc 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -43,6 +43,9 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup) int bHideOffline = db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
for (int j = 0; j < subcount; j++) {
MCONTACT hsub = db_mc_getSub(cont->hContact, j);
+ if (hsub == -1)
+ continue;
+
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hsub);
WORD wStatus = pdnce->getStatus();
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index f964409947..4a692a154d 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-void InsertContactIntoTree(MCONTACT hContact, int status);
-
wchar_t* UnknownConctactTranslatedName = nullptr;
void cliFreeCacheItem(ClcCacheEntry *p)
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index f50d0ba4f4..3413fdc5f0 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -76,10 +76,12 @@ ClcCacheEntry* fnGetCacheEntry(MCONTACT hContact) ClcCacheEntry *p;
int idx = clistCache.getIndex((ClcCacheEntry*)&hContact);
if (idx == -1) {
- if ((p = cli.pfnCreateCacheItem(hContact)) != nullptr) {
- clistCache.insert(p);
- cli.pfnInvalidateDisplayNameCacheEntry(hContact);
- }
+ p = cli.pfnCreateCacheItem(hContact);
+ if (p == nullptr)
+ return nullptr;
+
+ clistCache.insert(p);
+ cli.pfnInvalidateDisplayNameCacheEntry(hContact);
}
else p = clistCache[idx];
|