Replace nullptr by reset().