summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clistsettings.cpp8
-rw-r--r--src/mir_app/src/contacts.cpp3
2 files changed, 10 insertions, 1 deletions
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)