Check for non-empty string before writing to logger (fixes issue #2825)

This commit is contained in:
Andy Tzeng 2019-12-31 15:48:21 +00:00 committed by Marshall Greenblatt
parent 1c88c74f86
commit a94dc6a058
1 changed files with 6 additions and 4 deletions

View File

@ -256,10 +256,12 @@ ErrnoLogMessage::~ErrnoLogMessage() {
} // namespace cef
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
cef_string_utf8_t str = {0};
std::wstring tmp_str(wstr);
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
out << str.str;
cef_string_utf8_clear(&str);
if (!tmp_str.empty()) {
cef_string_utf8_t str = {0};
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
out << str.str;
cef_string_utf8_clear(&str);
}
return out;
}