fix a flipped NULL pointer check