Skip to content
Snippets Groups Projects
Commit 9de243b2 authored by Römer's avatar Römer
Browse files

Check if actor is null before checking interfaces

parent 6edddcbc
Branches
Tags
3 merge requests!22Get changes and fixes from 4.26 into 5 as well,!11add HitActor Interaction bug fix into 4.27,!10Fixed Nullpointer Exception when Interacting with BrushActor
......@@ -63,7 +63,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
PressPointerKey(EKeys::LeftMouseButton);
if (HitActor->Implements<UGrabable>() && Hit->Distance < MaxGrabDistance)
if (HitActor && HitActor->Implements<UGrabable>() && Hit->Distance < MaxGrabDistance)
{
// call grabable actors function so he reacts to our grab
IGrabable::Execute_OnBeginGrab(HitActor);
......@@ -76,7 +76,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
// we save the grabbedActor in a general form to access all of AActors functions easily later
GrabbedActor = HitActor;
}
else if (HitActor->Implements<UClickable>() && Hit->Distance < MaxClickDistance)
else if (HitActor && HitActor->Implements<UClickable>() && Hit->Distance < MaxClickDistance)
{
IClickable::Execute_OnClick(HitActor, Hit->Location);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment