Pārlūkot izejas kodu

AK: LogStream should handle being passed a null const char*

Andreas Kling 5 gadi atpakaļ
vecāks
revīzija
783c99516a
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      AK/LogStream.h

+ 2 - 0
AK/LogStream.h

@@ -85,6 +85,8 @@ public:
 
 
 inline const LogStream& operator<<(const LogStream& stream, const char* value)
 inline const LogStream& operator<<(const LogStream& stream, const char* value)
 {
 {
+    if (!value)
+        return stream << "(null)";
     int length = 0;
     int length = 0;
     const char* p = value;
     const char* p = value;
     while (*(p++))
     while (*(p++))