changed nullptr to string.length <= 0