You’re absolutely right, but this is true for pure C++.
Epic had the ridiculous idea to add GC to cpp. And thanks to this, the ubiquitous checking of nullptr, the lack of information about who owns the resource, behind-the-scenes nulling, etc.
I think it’s a good idea and even mandatory to have GC. Wouldn’t it be a nightmare to manage pointers and objects lifetimes? That would be completely unmanageable in a complex software.
From the epic documentantion:
When an AActor or UActorComponent is destroyed or otherwise removed from play, all references to it that are visible to the reflection system (UProperty pointers and pointers stored in Unreal Engine container classes such as TArray ) are automatically nulled. This is beneficial in that it prevents dangling pointers from persisting and causing trouble down the road, but it also means that AActor and UActorComponent pointers can become null if some other piece of code destroys them
Unreal Object Handling | Unreal Engine Documentation
So it’s possible that the pointers stored in the array become NULL by magic and a check for NULL should be made.