- Added validation to avoid trying to parse an empty string