Solving for the Null Pointer Early

I can’t do it, I just can’t let an app crash simply because of a null pointer. I’m not strong enough.
This is extra credit for those that are curious about it. I do this all the time. It must be done.

if (IsValid(ActorThatOpens) && IsValid(PressurePlate) && PressurePlate->IsOverlappingActor(ActorThatOpens))
{
	OpenDoor(DeltaTime);
}
2 Likes

Amazing job! This is good code habits!

Privacy & Terms