summaryrefslogtreecommitdiff
path: root/AK/LogStream.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-04 19:25:57 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-04 21:04:06 +0100
commit783c99516a92faced0d2d5b030ef862d64b19c48 (patch)
tree8141b383e4ba9d2301fa7b239b50dcd9b0135cfa /AK/LogStream.h
parent028c011760b5b665fc2a72bb3c11fd3a6ca60d2c (diff)
downloadserenity-783c99516a92faced0d2d5b030ef862d64b19c48.zip
AK: LogStream should handle being passed a null const char*
Diffstat (limited to 'AK/LogStream.h')
-rw-r--r--AK/LogStream.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/LogStream.h b/AK/LogStream.h
index e0fa4e9ce3..63e728d960 100644
--- a/AK/LogStream.h
+++ b/AK/LogStream.h
@@ -85,6 +85,8 @@ public:
inline const LogStream& operator<<(const LogStream& stream, const char* value)
{
+ if (!value)
+ return stream << "(null)";
int length = 0;
const char* p = value;
while (*(p++))