From 1a1dc745c2e02d60970299234b12f7ea87d88085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 1 Apr 2014 17:44:28 +0000 Subject: Fix possible crash in previous commit git-svn-id: http://svn.miranda-ng.org/main/trunk@8816 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/path.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/modules/utils/path.cpp') diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 2d9dcf9c52..2a4bcaa530 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -289,8 +289,11 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, MCONTACT hContact) theValue = GetContactNickX(key, hContact); else if (!_xcscmp(theKey, XSTR(key, "proto"))) theValue = mir_a2x(key, GetContactProto(hContact)); - else if (!_xcscmp(theKey, XSTR(key, "accountname"))) - theValue = mir_a2x(key, _T2A(ProtoGetAccount(GetContactProto(hContact))->tszAccountName)); + else if (!_xcscmp(theKey, XSTR(key, "accountname"))) { + PROTOACCOUNT *acc = ProtoGetAccount(GetContactProto(hContact)); + if (acc != NULL) + theValue = mir_a2x(key, _T2A(acc->tszAccountName)); + } else if (!_xcscmp(theKey, XSTR(key, "userid"))) theValue = GetContactIDX(key, hContact); } -- cgit v1.2.3