Check for null reference and empty string