refine assertion to allow null pointer assignment