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 e8680c0482
commit 6ef19fd061

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;
}