diff options
author | George Hazan <george.hazan@gmail.com> | 2024-06-06 18:30:09 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-06-06 18:30:09 +0300 |
commit | 194acc9d86eb5ffd14426210b9af4b1ed645c29f (patch) | |
tree | 22004863feb4e5a764ccf06a41545e22fc1859b3 | |
parent | 5b70baa32617190d97f36e389c11140d389e093c (diff) |
MsgExport: fix for rare crash
-rw-r--r-- | plugins/Msg_Export/src/export.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Msg_Export/src/export.cpp b/plugins/Msg_Export/src/export.cpp index ca2b9e108a..6615db1315 100644 --- a/plugins/Msg_Export/src/export.cpp +++ b/plugins/Msg_Export/src/export.cpp @@ -300,8 +300,10 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, const wstring &sF if (auto *si = Chat_Find(hContact, szProto)) { if (auto *pUser = g_chatApi.UM_FindUser(si, Utf2T(dbei.szUserId))) sRemoteUser = pUser->pszNick; - else - sRemoteUser = Utf2T(dbei.szUserId); + else { + Utf2T tmp(dbei.szUserId); + sRemoteUser = (tmp) ? tmp.get() : _A2T(dbei.szUserId); + } } // Get time stamp @@ -416,9 +418,7 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, const wstring &sF break; } } - else { - output.AppendFormat(TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob); - } + else output.AppendFormat(TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob); output.Append(g_plugin.bAppendNewLine ? L"\r\n\r\n" : L"\r\n"); if (!bWriteTextToFile(hFile, output, bWriteUTF8Format, output.GetLength())) |