diff --git a/packages/googlecloud/functions/getanswer/inquirer.py b/packages/googlecloud/functions/getanswer/inquirer.py index d219915d..db223fd5 100644 --- a/packages/googlecloud/functions/getanswer/inquirer.py +++ b/packages/googlecloud/functions/getanswer/inquirer.py @@ -16,10 +16,13 @@ def convert_date_format(date_str): """Convert date from 'MM-DD-YYYY' to 'MM/DD/YYYY' format.""" + if date_str is None or not isinstance(date_str, str): + return "date not available" + try: return datetime.strptime(date_str, "%m-%d-%Y").strftime("%m/%d/%Y") except ValueError: - return date_str # Return original string if format does not match + return "date not available" def timestamp_to_seconds(timestamp):