Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: base/logging.cc

Issue 1778083003: base: Add nullptr checks to logging.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.cc
diff --git a/base/logging.cc b/base/logging.cc
index 9ad50e8d9934d8f941aafae0083174bd53f9ebba..8ff226082e60b2fbd9999329bd0dccc5ca3b1d60 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -862,7 +862,7 @@ void CloseLogFile() {
}
void RawLog(int level, const char* message) {
- if (level >= g_min_log_level) {
+ if (level >= g_min_log_level && message) {
size_t bytes_written = 0;
const size_t message_len = strlen(message);
int rv;
@@ -915,5 +915,5 @@ BASE_EXPORT void LogErrorNotReached(const char* file, int line) {
} // namespace logging
std::ostream& std::operator<<(std::ostream& out, const wchar_t* wstr) {
- return out << base::WideToUTF8(wstr);
+ return out << (wstr ? base::WideToUTF8(wstr) : std::string());
Mark Mentovai 2016/03/10 18:06:54 Your description only mentions RawLog(). Make it a
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698