# How to handle null pointers

**URL:** <https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086>\
**Category:** Platform & Builds\
**Tags:** nullptr, unreal-engine, question\
**Created:** [January 11, 2021, 1:56pm UTC](https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086 "2021-01-11T13:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RemzDNB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/remzdnb/32/88719_2.png) [@RemzDNB](https://forums.unrealengine.com/u/RemzDNB)\
**Post date:** [January 11, 2021, 1:56pm UTC](https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086/1 "2021-01-11T13:56:30Z")

</div>

Hey guys, quite new to C++ stuff here !  
I was wondering, how do you handle invalid references without crashing the whole engine ?  
For example I’m loading a DataTable from my code with FObjectFinder and a hard path. I can check if the pointer is nullptr, then log something like “Missing DataTable”, but what then ? If the game keeps running, it will crash the engine, I rather want it to stop and go back to the editor, so I can read the log and correct my mistake.  
What should I do ? I could exit it with a console command but it seems ugly to me. I also read about stuff like check() and assert() but I don’t understand how it works and it should also crash the editor, so that’s not what I’m looking for.  
Thanks  
Remz

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [January 11, 2021, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-handle-null-pointers/477086/2 "2021-01-11T15:41:30Z")

</div>

[https://forums.unrealengine.com/development-discussion/c-gameplay-programming/30540-how-to-use-assert-in-a-debug-build](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/30540-how-to-use-assert-in-a-debug-build)
