diff --git a/base/base_tests/logging_test.cpp b/base/base_tests/logging_test.cpp index ff4bd4d73c..bca3f04efc 100644 --- a/base/base_tests/logging_test.cpp +++ b/base/base_tests/logging_test.cpp @@ -38,3 +38,9 @@ UNIT_TEST(Logging_Level) my::SetLogMessageFn(logMessageSaved); my::g_LogLevel = logLevelSaved; } + +UNIT_TEST(NullMessage) +{ + char const * ptr = 0; + LOG(LINFO, ("Null message test", ptr)); +} diff --git a/base/internal/message.hpp b/base/internal/message.hpp index 9b3122fcd9..726d0860b4 100644 --- a/base/internal/message.hpp +++ b/base/internal/message.hpp @@ -28,7 +28,10 @@ template inline string DebugPrint(map const & v); inline string DebugPrint(char const * t) { - return DebugPrint(string(t)); + if (t) + return DebugPrint(string(t)); + else + return string("NULL string pointer"); } inline string DebugPrint(char t)