From 2cd7967ec494d5d5be9bf8d798538a3f530bdb11 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 6 Sep 2022 21:53:14 +0200 Subject: [PATCH] Fix crash on Linux with empty log message --- Source/Engine/Core/Log.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/Core/Log.cpp b/Source/Engine/Core/Log.cpp index ea24f5b27..6daf82e37 100644 --- a/Source/Engine/Core/Log.cpp +++ b/Source/Engine/Core/Log.cpp @@ -107,6 +107,8 @@ void Log::Logger::Write(const StringView& msg) { const auto ptr = msg.Get(); const auto length = msg.Length(); + if (length <= 0) + return; LogLocker.Lock(); if (IsDuringLog) @@ -230,6 +232,8 @@ void Log::Logger::ProcessLogMessage(LogType type, const StringView& msg, fmt_fla void Log::Logger::Write(LogType type, const StringView& msg) { + if (msg.Length() <= 0) + return; const bool isError = IsError(type); // Create message for the log file