From 6d6102f6b734e26cbc3ffae86502c15644c531c5 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Thu, 21 Nov 2024 00:36:58 +1300 Subject: [PATCH] fix: crash that happens when running with automated tests (#3331) --- .../Immutable/Private/Immutable/ImtblBlui.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/Immutable/Private/Immutable/ImtblBlui.cpp b/Source/Immutable/Private/Immutable/ImtblBlui.cpp index 8b085f4..c991b81 100644 --- a/Source/Immutable/Private/Immutable/ImtblBlui.cpp +++ b/Source/Immutable/Private/Immutable/ImtblBlui.cpp @@ -35,15 +35,18 @@ void UImtblBlui::OnLogEvent(const FString& LogText) void UImtblBlui::WorldTickStart(UWorld* World, ELevelTick LevelTick, float X) { #if USING_BLUI_CEF - if (!GetBluEye()->IsBrowserLoading() && !bLoadedIndexJS) + if (UBluEye* BluEye = GetBluEye()) { - FString JavaScript; - - IMTBL_LOG("BLUI CEF Browser loaded"); - bLoadedIndexJS = true; - if (FImmutableUtilities::LoadGameBridge(JavaScript)) + if (!BluEye->IsBrowserLoading() && !bLoadedIndexJS) { - GetBluEye()->ExecuteJS(JavaScript); + FString JavaScript; + + IMTBL_LOG("BLUI CEF Browser loaded"); + bLoadedIndexJS = true; + if (FImmutableUtilities::LoadGameBridge(JavaScript)) + { + BluEye->ExecuteJS(JavaScript); + } } } #endif