Fix crash on Linux with empty log message

This commit is contained in:
Wojtek Figat
2022-09-06 21:53:14 +02:00
parent 73d0fc4973
commit 2cd7967ec4

View File

@@ -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