Commit 17a46e3
fix(events): init EventUser only if actor is defined
Prevents the following TypeError with events of deleted users (aka "ghost"):
```
File "/path/to/github3/models.py", line 52, in __init__
self._update_attributes(json)
File "/path/to/github3/issues/event.py", line 63, in _update_attributes
self.actor = users.ShortUser(event["actor"], self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/github3/models.py", line 52, in __init__
self._update_attributes(json)
File "/path/to/github3/users.py", line 309, in _update_attributes
self.avatar_url = user["avatar_url"]
TypeError: 'NoneType' object is not subscriptable
```1 parent 03d4bc5 commit 17a46e3
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
0 commit comments