mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Guard against trying to take focus on shutdown
This commit is contained in:
parent
7fb56434ec
commit
191ab410aa
@ -66,7 +66,8 @@ void FFocusSystem::FocusableWidgetDestructed(UFocusableUserWidget* Widget)
|
|||||||
if (Widget->HasFocusedDescendants())
|
if (Widget->HasFocusedDescendants())
|
||||||
{
|
{
|
||||||
auto Highest = GetHighestFocusPriority();
|
auto Highest = GetHighestFocusPriority();
|
||||||
if (Highest.IsValid())
|
// Make sure player controller is valid too, this could be on shutdown
|
||||||
|
if (Highest.IsValid() && Highest->GetOwningPlayer())
|
||||||
{
|
{
|
||||||
UE_LOG(LogFocusSystem, Display, TEXT("Giving focus to %s"), *Highest->GetName());
|
UE_LOG(LogFocusSystem, Display, TEXT("Giving focus to %s"), *Highest->GetName());
|
||||||
Highest->TakeFocusIfDesired();
|
Highest->TakeFocusIfDesired();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user