From d77cd7730ff36f38b9a8a8619c8b801646f7b928 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 27 Apr 2018 22:28:15 +0200 Subject: fixes #1310 (Wrong language after profile conversion) --- src/mir_app/src/miranda.h | 1 - src/mir_core/src/db.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index e1674f4b06..645fd36013 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -201,5 +201,4 @@ extern "C" { MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(PLUGININFOEX* pInfo); MIR_CORE_DLL(int) GetSubscribersCount(struct THook *hHook); - MIR_CORE_DLL(void) db_setCurrent(MDatabaseCommon *_db); }; diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 04efa68510..69e998c53c 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -437,9 +437,11 @@ MIR_CORE_DLL(MCONTACT) db_find_next(MCONTACT hContact, const char *szProto) return (currDb == nullptr) ? NULL : currDb->FindNextContact(hContact, szProto); } -extern "C" MIR_CORE_DLL(void) db_setCurrent(MDatabaseCommon *_db) +MIR_CORE_DLL(void) db_setCurrent(MDatabaseCommon *_db) { currDb = _db; + if (currDb == nullptr) + return; // try to get the langpack's name from a profile ptrW langpack(db_get_wsa(NULL, "Langpack", "Current")); -- cgit v1.2.3