Skip to content

Commit b112b43

Browse files
authored
Merge pull request #490 from Iamrodos/fix/489-empty-repo-none-comparison
Fix empty repository crash due to None timestamp comparison (#489)
2 parents 6006765 + f54a545 commit b112b43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github_backup/github_backup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,9 +1772,9 @@ def backup_repositories(args, output_directory, repositories):
17721772

17731773
last_update = "0000-00-00T00:00:00Z"
17741774
for repository in repositories:
1775-
if "updated_at" in repository and repository["updated_at"] > last_update:
1775+
if repository.get("updated_at") and repository["updated_at"] > last_update:
17761776
last_update = repository["updated_at"]
1777-
elif "pushed_at" in repository and repository["pushed_at"] > last_update:
1777+
elif repository.get("pushed_at") and repository["pushed_at"] > last_update:
17781778
last_update = repository["pushed_at"]
17791779

17801780
if repository.get("is_gist"):

0 commit comments

Comments
 (0)