summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-04-01 17:44:28 +0000
committerRobert Pösel <robyer@seznam.cz>2014-04-01 17:44:28 +0000
commit1a1dc745c2e02d60970299234b12f7ea87d88085 (patch)
tree348263f48f70141f2f6ab20b9852a3f80afeea80 /src/modules
parentefcd6b99eb4d3fec0bd4c6e3f7fe684b512e76d9 (diff)
Fix possible crash in previous commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@8816 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/utils/path.cpp7
1 files changed, 5 insertions, 2 deletions
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);
}