summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-17 18:19:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-17 18:19:59 +0300
commite5381d4e4b8e5657d9e7a275e293f2a42f7d74d8 (patch)
tree2589b6475ff3b1cdd4a08e267650ab73ce798de7
parent35f9a15441bc6b23463d09f1ebe0490b386209c5 (diff)
fixes crash for #1490
-rwxr-xr-xplugins/Msg_Export/src/stdafx.h1
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp4
2 files changed, 5 insertions, 0 deletions
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 <m_clist.h>
#include <m_contacts.h>
#include <m_langpack.h>
+#include <m_netlib.h>
#include <m_options.h>
#include <m_history.h>
#include <m_userinfo.h>
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);