Skip to content

Commit

Permalink
fixed crash during level switch
Browse files Browse the repository at this point in the history
  • Loading branch information
pasotee committed Apr 5, 2024
1 parent 8c7c58e commit 7dac62a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Source/TolgeeEditor/Private/STolgeeTranslationTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,19 @@ void STolgeeTranslationTab::OnActiveTabChanged(TSharedPtr<SDockTab> PreviouslyAc

void STolgeeTranslationTab::DebugDrawCallback(UCanvas* Canvas, APlayerController* PC)
{
FSlateApplication& Application = FSlateApplication::Get();
FWidgetPath WidgetPath = Application.LocateWindowUnderMouse(Application.GetCursorPos(), Application.GetInteractiveTopLevelWindows());
if(!GEngine->GameViewport)
{
return;
}

TSharedPtr<SViewport> GameViewportWidget = GEngine->GameViewport->GetGameViewportWidget();
if(!GameViewportWidget.IsValid())
{
return;
}

FSlateApplication& Application = FSlateApplication::Get();
FWidgetPath WidgetPath = Application.LocateWindowUnderMouse(Application.GetCursorPos(), Application.GetInteractiveTopLevelWindows());

#if UE_VERSION_NEWER_THAN(5, 0, 0)
const bool bValidHover = WidgetPath.Widgets.Num() > 0 && WidgetPath.ContainsWidget(GameViewportWidget.Get());
Expand Down

0 comments on commit 7dac62a

Please sign in to comment.