From 42563b1b6cf473a4ba10a327ac79adfc66ec71ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 Feb 2013 17:52:28 +0000 Subject: bugfix: LoadSkinProtoIcon returns global icons when a protocol is not fully created git-svn-id: http://svn.miranda-ng.org/main/trunk@3737 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/skin/skinicons.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index b5f876e4cd..b9400eeedf 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -216,15 +216,19 @@ void Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId) // HICON LoadSkinProtoIcon(const char* szProto, int status, bool big) { - int statusIndx = -1; char iconName[MAX_PATH]; - DWORD caps2 = (szProto == NULL) ? (DWORD)-1 : CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_2, 0); + INT_PTR caps2; + if (szProto == NULL) + caps2 = -1; + else if ((caps2 = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_2, 0)) == CALLSERVICE_NOTFOUND) + caps2 = 0; if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) { mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, 7); return IcoLib_GetIcon(iconName, big); } + int statusIndx = -1; for (int i=0; i < SIZEOF(statusIcons); i++) { if (statusIcons[i].id == status) { statusIndx = i; -- cgit v1.2.3