From edf18049997d00eaad7a2fab9581176782182535 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 Dec 2018 20:19:17 +0300 Subject: std::string cannot accept nullptr as a parameter --- plugins/CurrencyRates/src/DBUtils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/CurrencyRates') diff --git a/plugins/CurrencyRates/src/DBUtils.cpp b/plugins/CurrencyRates/src/DBUtils.cpp index cdc6560db7..0645387d9e 100644 --- a/plugins/CurrencyRates/src/DBUtils.cpp +++ b/plugins/CurrencyRates/src/DBUtils.cpp @@ -2,11 +2,17 @@ std::string CurrencyRates_DBGetStringA(MCONTACT hContact, const char* szModule, const char* szSetting, const char* pszDefValue) { + if (pszDefValue == nullptr) + pszDefValue = ""; + return std::string(ptrA(db_get_sa(hContact, szModule, szSetting, pszDefValue))); } std::wstring CurrencyRates_DBGetStringW(MCONTACT hContact, const char* szModule, const char* szSetting, const wchar_t* pszDefValue) { + if (pszDefValue == nullptr) + pszDefValue = L""; + return std::wstring(ptrW(db_get_wsa(hContact, szModule, szSetting, pszDefValue))); } -- cgit v1.2.3