summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/dialogs.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-08-11 13:52:39 +0000
committerRobert Pösel <robyer@seznam.cz>2014-08-11 13:52:39 +0000
commite6b2c1aafe3e877e3a6a90df006887d0b5f59f3d (patch)
tree09f6f8c440f9df9fdeec116ab69f1b245b5ef5e9 /protocols/FacebookRM/src/dialogs.cpp
parentd3e19377a2898c86499b31ca2ea85f8fce643438 (diff)
Facebook: Fix various ptrA issues (potential crashes)
git-svn-id: http://svn.miranda-ng.org/main/trunk@10152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/dialogs.cpp')
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index c3af445c23..4f77b2c53d 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -152,8 +152,15 @@ void GetSelectedContacts(FacebookProto *proto, MCONTACT hItem, HWND hwndList, st
} else {
if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
facebook_user *fu = new facebook_user();
- fu->user_id = ptrA(proto->getStringA(hItem, FACEBOOK_KEY_ID));
- fu->real_name = _T2A(ptrT(proto->getTStringA(hItem, FACEBOOK_KEY_NICK)));
+
+ ptrA userId(proto->getStringA(hItem, FACEBOOK_KEY_ID));
+ if (userId)
+ fu->user_id = userId;
+
+ ptrt realName(proto->getTStringA(hItem, FACEBOOK_KEY_NICK));
+ if (realName)
+ fu->real_name = _T2A(realName);
+
contacts->push_back(fu);
}
}
@@ -265,7 +272,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
TCHAR mindMessageT[FACEBOOK_MIND_LIMIT+1];
TCHAR urlT[1024];
- TCHAR placeT[100];
+ TCHAR placeT[100];
GetDlgItemText(hwnd, IDC_MINDMSG, mindMessageT, SIZEOF(mindMessageT));
GetDlgItemText(hwnd, IDC_PLACE, placeT, SIZEOF(placeT));