summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp3
-rw-r--r--src/mir_app/src/clistsettings.cpp8
-rw-r--r--src/mir_app/src/contacts.cpp3
3 files changed, 13 insertions, 1 deletions
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 7bf3c4aff2..2440bbec89 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -516,6 +516,9 @@ ClcContact* cliCreateClcContact()
ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact)
{
+ if (hContact == NULL)
+ return NULL;
+
ClcCacheEntry *pdnce = (ClcCacheEntry *)mir_calloc(sizeof(ClcCacheEntry));
if (pdnce == NULL)
return NULL;
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp
index 54d36ca38f..0e245c4d63 100644
--- a/src/mir_app/src/clistsettings.cpp
+++ b/src/mir_app/src/clistsettings.cpp
@@ -41,6 +41,9 @@ void FreeDisplayNameCache(void)
ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact)
{
+ if (hContact == NULL)
+ return NULL;
+
ClcCacheEntry *p = (ClcCacheEntry*)mir_calloc(sizeof(ClcCacheEntry));
if (p == NULL)
return NULL;
@@ -99,8 +102,10 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact)
TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
{
+ if (hContact == NULL)
+ return TranslateT("(Unknown contact)");
+
ClcCacheEntry *cacheEntry = NULL;
-
if (mode & GCDNF_NOCACHE)
mode &= ~GCDNF_NOCACHE;
else if (mode != GCDNF_NOMYHANDLE) {
@@ -117,6 +122,7 @@ TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
}
CallContactService(hContact, PSS_GETINFO, SGIF_MINIMAL, 0);
+
TCHAR *buffer = TranslateT("(Unknown contact)");
return (cacheEntry == NULL) ? mir_tstrdup(buffer) : buffer;
}
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp
index e2c679dcc3..5e6a6bc52b 100644
--- a/src/mir_app/src/contacts.cpp
+++ b/src/mir_app/src/contacts.cpp
@@ -87,6 +87,9 @@ static TCHAR* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szProto
MIR_APP_DLL(TCHAR*) Contact_GetInfo(int type, MCONTACT hContact, const char *szProto)
{
+ if (hContact == NULL && szProto == NULL)
+ return NULL;
+
if (szProto == NULL)
szProto = Proto_GetBaseAccountName(hContact);
if (szProto == NULL)