From 0b8b13b60a69676ef22fd137c3ff456ccfaf0932 Mon Sep 17 00:00:00 2001
From: Ehret <jw210150@WIN.RZ.RWTH-AACHEN.DE>
Date: Fri, 21 Jan 2022 10:56:03 +0100
Subject: [PATCH] also check whether HitActor is not nullptr on Tick
 (apparently Actor can be nullptr even if isSet is true) adding to the fix in
 commit 9de243b254167697c28ba4290bc6d5debf907514

---
 .../RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp
index a19bc88d..eaf5a577 100644
--- a/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp
+++ b/Source/RWTHVRToolkit/Private/Pawn/BasicVRInteractionComponent.cpp
@@ -138,7 +138,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic
 	const FTwoVectors StartEnd = GetHandRay(MaxClickDistance);
 	TOptional<FHitResult> Hit = RaytraceForFirstHit(StartEnd);
 
-	if (!Hit.IsSet())
+	if (!Hit.IsSet() || !Hit->GetActor())
 	{
 		if(InteractionRayVisibility==EInteractionRayVisibility::VisibleOnHoverOnly)
 		{
-- 
GitLab