diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-09-29 20:10:29 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-09-29 20:10:29 +0000 |
commit | 1a0a1659277b5a64c333e9bf512fddbea4317185 (patch) | |
tree | dff13166a92a9e655105ab3d7a3067bcd010353e /protocols/Tox/src/tox_profile.cpp | |
parent | 479c3b3734c647801335806faabd30bca79c207e (diff) |
Tox: fixed crashes on tox profile saving/loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@10642 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r-- | protocols/Tox/src/tox_profile.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 1ad015dee3..88248f7c27 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -12,6 +12,11 @@ std::tstring CToxProto::GetToxProfilePath() void CToxProto::LoadToxProfile()
{
+ if (tox == NULL)
+ {
+ return;
+ }
+
std::tstring toxProfilePath = GetToxProfilePath();
FILE *hFile = _wfopen(toxProfilePath.c_str(), _T("rb"));
if (!hFile)
@@ -63,6 +68,11 @@ void CToxProto::LoadToxProfile() void CToxProto::SaveToxProfile()
{
+ if (tox == NULL)
+ {
+ return;
+ }
+
std::tstring toxProfilePath = GetToxProfilePath();
FILE *hFile = _wfopen(toxProfilePath.c_str(), _T("wb"));
if (!hFile)
|