Replace an incorrect check for an empty string