Skip to content
Snippets Groups Projects
Commit ec484459 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

hotfix(interaction): fixes crash that can happen when a previously grabbed item gets destroyed

parent 75b578ca
Branches
No related tags found
1 merge request!113Pull dev/5.4 changes into dev/5.5
Pipeline #561157 failed
......@@ -70,6 +70,13 @@ void UDirectInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tick
// Call hover end events on all components that were previously in range, but not anymore
for (UInteractableComponent* PrevInteractableComp : PreviousInteractableComponentsInRange)
{
// It can happen that a previous component was destroyed
if (!PrevInteractableComp || !PrevInteractableComp->IsValidLowLevel())
{
ComponentsToRemove.Add(PrevInteractableComp); // might have to use indices here
continue;
}
if (!CurrentInteractableCompsInRange.Contains(PrevInteractableComp))
{
ComponentsToRemove.AddUnique(PrevInteractableComp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment