Hi,
I just want to show you my solution for nullptr on the PhysicsHandle:
PhysicsHandle = GetOwner()->FindComponentByClass<UPhysicsHandleComponent>();
if(PhysicsHandle)
{
//PhysicsHandle found
}
else
{
UE_LOG(LogTemp, Error, TEXT("GRABBER OFFLINE. PhysicsHandleComponent not found on %s"), *(GetOwner()->GetName()));
this->DestroyComponent(); //Stop Grabber from working by removing it.
}
}
I think this is a propper way to ensure, that a crash will not happen, even with future code added.
Cheers