mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-05 15:18:47 +00:00
CogEngine: Fix crash related to log and notification
This commit is contained in:
@@ -14,9 +14,9 @@ void FCogEngineWindow_Notifications::Initialize()
|
|||||||
{
|
{
|
||||||
Super::Initialize();
|
Super::Initialize();
|
||||||
|
|
||||||
OutputDevice.Notifications = this;
|
|
||||||
|
|
||||||
Config = GetConfig<UCogEngineConfig_Notifications>();
|
Config = GetConfig<UCogEngineConfig_Notifications>();
|
||||||
|
|
||||||
|
OutputDevice.Notifications = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -46,6 +46,9 @@ void FCogEngineWindow_Notifications::AddNotification(const TCHAR* InMessage, ELo
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void FCogEngineWindow_Notifications::OnLogReceived(const TCHAR* InMessage, ELogVerbosity::Type InVerbosity, const class FName& InCategory)
|
void FCogEngineWindow_Notifications::OnLogReceived(const TCHAR* InMessage, ELogVerbosity::Type InVerbosity, const class FName& InCategory)
|
||||||
{
|
{
|
||||||
|
if (Config == nullptr)
|
||||||
|
{ return; }
|
||||||
|
|
||||||
if (Config->DisableNotifications)
|
if (Config->DisableNotifications)
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void FCogEngineWindow_OutputLog::AddLog(const TCHAR* InMessage, ELogVerbosity::T
|
|||||||
|
|
||||||
FLogInfo& LogInfo = LogInfos.AddDefaulted_GetRef();
|
FLogInfo& LogInfo = LogInfos.AddDefaulted_GetRef();
|
||||||
LogInfo.Frame = GFrameCounter;
|
LogInfo.Frame = GFrameCounter;
|
||||||
LogInfo.Time = Config->UseUTCTime ? FDateTime::UtcNow() : FDateTime::Now();
|
LogInfo.Time = Config != nullptr && Config->UseUTCTime ? FDateTime::UtcNow() : FDateTime::Now();
|
||||||
LogInfo.Verbosity = InVerbosity;
|
LogInfo.Verbosity = InVerbosity;
|
||||||
LogInfo.Category = InCategory;
|
LogInfo.Category = InCategory;
|
||||||
LogInfo.LineStart = TextBuffer.size();
|
LogInfo.LineStart = TextBuffer.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user