From de93824498f8ad4a7d79ec52929ebff92672e76b Mon Sep 17 00:00:00 2001 From: Nicolai Ehemann Date: Tue, 11 Apr 2017 11:10:03 +0200 Subject: [PATCH] Fix error when repository has no updated_at value --- bin/github-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/github-backup b/bin/github-backup index 5a2a635..469987e 100755 --- a/bin/github-backup +++ b/bin/github-backup @@ -520,7 +520,7 @@ def backup_repositories(args, output_directory, repositories): repos_template = 'https://{0}/repos'.format(get_github_api_host(args)) if args.incremental: - last_update = max(repository['updated_at'] for repository in repositories) # noqa + last_update = max(list(repository['updated_at'] for repository in repositories) or [time.strftime('%Y-%m-%dT%H:%M:%SZ', time.localtime())]) # noqa last_update_path = os.path.join(output_directory, 'last_update') if os.path.exists(last_update_path): args.since = open(last_update_path).read().strip()