Просмотр исходного кода

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

Andreas Kling 5 лет назад
Родитель
Сommit
783c99516a
1 измененных файлов с 2 добавлено и 0 удалено
  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)
 {
+    if (!value)
+        return stream << "(null)";
     int length = 0;
     const char* p = value;
     while (*(p++))