correct null pointer check bug.