if(NULL != X) to X. More NULL checking