I was curious what will be happened if I pass pointer val set as nullptr to reference val.
Here is the test code below.
AActor* Actor = nullptr;
AActor* Actor2 = Actor;
AActor& ActorRef = *Actor;
if (&ActorRef == nullptr)
{
UE_LOG(LogTemp, Warning, TEXT("actorRef is null."));
}
As you expected, there is no warning or error for this. It just works.
But you don’t need to worry about it. And don’t do null check for ref val.
You should ignore this case from your mind.