add check null pointer in Pointer class