From e5381d4e4b8e5657d9e7a275e293f2a42f7d74d8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 17 Aug 2018 18:19:59 +0300 Subject: fixes crash for #1490 --- plugins/Msg_Export/src/stdafx.h | 1 + plugins/Msg_Export/src/utils.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/Msg_Export/src/stdafx.h b/plugins/Msg_Export/src/stdafx.h index 14147793e0..b2be179c48 100755 --- a/plugins/Msg_Export/src/stdafx.h +++ b/plugins/Msg_Export/src/stdafx.h @@ -33,6 +33,7 @@ using namespace std; #include #include #include +#include #include #include #include diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 27b12dd673..ddafc4b599 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -716,6 +716,10 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, wstring sFilePath } else { const char *szProto = GetContactProto(hContact); + if (szProto == nullptr) { + Netlib_Logf(0, MODULENAME ": cannot write message for a contact %d without protocol", hContact); + return false; + } if (g_bUseJson) { JSONNode pRoot, pInfo, pHist(JSON_ARRAY); -- cgit v1.2.3