From 1a0a1659277b5a64c333e9bf512fddbea4317185 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 29 Sep 2014 20:10:29 +0000 Subject: Tox: fixed crashes on tox profile saving/loading git-svn-id: http://svn.miranda-ng.org/main/trunk@10642 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_profile.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'protocols/Tox') 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) -- cgit v1.2.3