PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

AttributeError when iterating over comments on certain videos #26

Closed Oshawk closed 3 years ago

Oshawk commented 3 years ago

Code to reproduce:

from twitch import Helix

helix = Helix("REDACTED", "REDACTED")

for i in helix.video(873841025).comments:
    pass

Error:

Traceback (most recent call last):
  File "REDACTED", line 5, in <module>
    for i in helix.video(873841025).comments:
  File "REDACTED", line 24, in __iter__
    yield v5.Comment(api=self._api, data=comment)
  File "REDACTED", line 78, in __init__
    self.commenter: Commenter = Commenter(data.get('commenter'))
  File "REDACTED", line 13, in __init__
    self.display_name: str = data.get('display_name')
AttributeError: 'NoneType' object has no attribute 'get'

Process finished with exit code 1