Skip to content

Commit

Permalink
Merge pull request #5326 from stsewd/protect-against-api-failure
Browse files Browse the repository at this point in the history
Don't depend on specific data when catching exception
  • Loading branch information
ericholscher authored Feb 21, 2019
2 parents 55105bb + 8376557 commit ed8dd29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,11 @@ def run(
'stack': True,
'tags': {
'build': build_pk,
'project': self.project.slug,
'version': self.version.slug,
# We can't depend on these objects because the api
# could fail. But self.project and self.version are
# initialized as empty dicts in the init method.
'project': self.project.slug if self.project else None,
'version': self.version.slug if self.version else None,
},
},
)
Expand Down

0 comments on commit ed8dd29

Please sign in to comment.