diff --git a/src/migmose/parsing.py b/src/migmose/parsing.py index 7ddfa8d..c8af366 100644 --- a/src/migmose/parsing.py +++ b/src/migmose/parsing.py @@ -67,11 +67,11 @@ def extract_date(file_path: Path) -> tuple[datetime, Path]: # Initialize variables to keep track of the latest file and date latest_file: Path - latest_date: datetime + latest_date: datetime | None = None for file_path in file_list: date, path = extract_date(file_path) - if date > latest_date: + if latest_date is None or date > latest_date: latest_file = path latest_date = date