Skip to content

Commit 783c995

Browse files
committed
AK: LogStream should handle being passed a null const char*
1 parent 028c011 commit 783c995

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

AK/LogStream.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class KernelLogStream final : public LogStream {
8585

8686
inline const LogStream& operator<<(const LogStream& stream, const char* value)
8787
{
88+
if (!value)
89+
return stream << "(null)";
8890
int length = 0;
8991
const char* p = value;
9092
while (*(p++))

0 commit comments

Comments
 (0)