Fix the issue when the string is nil.