guard_action_component Attack(Target) crashes the server if the Target is eliminated (removed from scene) and you try to GetSuccess[]

Summary

Waiting on the guard_action_component’s Attack function to finish will crash the server if the entity set as the target is removed from scene. Similar to the bug experienced and reported here The guard_action_component does not properly return an ai_action_error_type result and will crash the server but with the opposite effect. This time, if the entity/component that is removed from scene that is performing the GAC.Attack(), the proper ai_action_error_type.Cancel gets fired and we see the function end.
What is different this time however, if the entity that is the target of GAC.Attack(TargetEntity) is removed from scene, ie. the agent is eliminated and you try to listen for the Result.GetSuccess[], this crashes the server. Even though the result success_type is void, a decides function should still pass. This crashing is not intended behavior.
Found because I was trying to get npcs to re-initate a follow and attack for a few seconds pattern. This is the code that will trigger the server crashing.

if(FC := AgentAndActionComp(0).GetFortCharacter[]): # Just make sure agent is alive and in world space to navigate to
    Target := MakeNavigationTarget(AgentAndActionComp(0))
    NavResult := Action.NavigateTo(Target, ?MovementType := MovementType)
    Action.Idle(?Duration := 0.5) # Wait before shooting
    if(FCE := FC.GetEntity[], AgentAndActionComp(1).IsSimulating[]):
        Result := Action.Attack(FCE)
        Print("Hello World") # <- This will show as (Rolling Back) Hello World when the server crashes
        if(ErrorType := Result.GetError[]):
            Print("Attack Error: {ErrorType}") # Only shows if Attacking NPC Dies (After about 5 seconds)
        if(Result.GetSuccess[]): # Crashes when the FCE is Eliminated
            Print("Attack Success") # Never shows

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Have an npc spawner with default behavior type Guard
Get guard_action_component
something like Result := GAC.Attack(Target)
eliminate target, either by letting the guard do it or you can
check if(Result.GetSuccess[])
Game Crashes

Expected Result

I would expect the result of the GAC.Attack(Target) so be successful or canceled once the entity is no longer a viable target. Either works in this case, as long as it doesn’t crash the server. Since it is crashing at checking the Success, this should still pass because the GetSuccess is a decides function it just needs to not fail to succeed.

Observed Result

When the entity is destroyed/eliminated during the GAC.Attack(Target) function, the server crashes.

Platform(s)

Windows/UEFN/PC

Upload an image

Video

Additional Notes

This will happen regardless of how the entity is destroyed, as long as it happens during the GAC.Attack(Target) method is executing.

FORT-1048718 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.