8000 Add check for null creator in Milestone. · pythonthings/github3.py@1093378 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1093378

Browse files
committed
Add check for null creator in Milestone.
This adds a check for whether the Milestone creator is null before trying to create a User object out of it.
1 parent 1fcde29 commit 1093378

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

github3/issues/milestone.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def _update_attributes(self, mile):
2626
self.description = mile.get('description')
2727
#: :class:`User <github3.users.User>` object representing the creator
2828
#: of the milestone.
29-
self.creator = User(mile.get('creator'), self)
29+
self.creator = None
30+
if mile.get('creator'):
31+
self.creator = User(mile.get('creator'), self)
3032
#: Number of issues associated with this milestone which are still
3133
#: open.
3234
self.open_issues = mile.get('open_issues')

0 commit comments

Comments
 (0)
0