Check for nil strings before parsing them