Fix NoneType error in GH trigger when it has no pushed_at field

This appears to occur in new repositories that have not yet been pushed.

Fixes 234686591/
This commit is contained in:
Joseph Schorr 2017-03-20 18:14:50 -04:00
parent 4bee4dbfff
commit 4cb8412fd8
2 changed files with 7 additions and 2 deletions

View file

@ -310,7 +310,7 @@ class GithubBuildTrigger(BuildTriggerHandler):
'name': repo.name,
'full_name': repo.full_name,
'description': repo.description or '',
'last_updated': timegm(repo.pushed_at.utctimetuple()),
'last_updated': timegm(repo.pushed_at.utctimetuple()) if repo.pushed_at else 0,
'url': repo.html_url,
'has_admin_permissions': repo.permissions.admin,
'private': repo.private,