diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-08 20:19:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-08 20:19:17 +0300 |
commit | edf18049997d00eaad7a2fab9581176782182535 (patch) | |
tree | 5a759b4101e7e78eda9f4cdfb79377f9c9cc8343 | |
parent | 8ffc77be71507825a8f7585bcabff8ccc370206a (diff) |
std::string cannot accept nullptr as a parameter
-rw-r--r-- | plugins/CurrencyRates/src/DBUtils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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))); } |