Check for null pointer, good pratice ?

I use copy of default check() macro.



#define GAMENAME_DEBUG 1

#if GAMENAME_DEBUG
	#define GAMENAME_CHECK(expr) { if(!(expr)) FDebug::AssertFailed( #expr, __FILE__, __LINE__ ); CA_ASSUME(expr); }
#else
	#define GAMENAME_CHECK(expr)
#endif





GAMENAME_CHECK(Pointer)

if(Pointer)
{
    // Do something
}


This solutions causes crash only when GAMENAME_DEBUG is 1. So when I ship my game I set it to 0 and end users will not experience asserts :slight_smile: