Refine null/undefined check.