Skip to content

Commit

Permalink
latest_date is nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidhajiparvaneh committed Apr 15, 2024
1 parent 9a646a3 commit fa7d688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/migmose/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fa7d688

Please sign in to comment.