tybug / ossapi

The definitive python wrapper for the osu! api.
https://tybug.github.io/ossapi/
GNU Affero General Public License v3.0
82 stars 18 forks source link

Rare TypeError when calling `api.events` #75

Closed yanda-dy closed 10 months ago

yanda-dy commented 10 months ago

Example:

api.events() # If I don't call this first in this case, it seems to just return the old Event model without additional event-specific information
cursor_string = "eyJldmVudF9pZCI6ODI4MDA1NDgyfQ"
sort_str = "id_asc"
events = api.events(cursor_string=cursor_string, sort=sort_str)

returns

- TypeError: 'NoneType' object is not iterable

Did some debugging and I believe it's something to do with supporter gift events - I think this is the specific event that triggers the error in this case:

UserSupportGiftEvent(created_at=datetime.datetime(2024, 1, 8, 4, 54, 11, tzinfo=datetime.timezone.utc), 
                     createdAt=datetime.datetime(2024, 1, 8, 4, 54, 11, tzinfo=datetime.timezone.utc), 
                     id=828005503, 
                     type=<EventType.USER_SUPPORT_GIFT: 'userSupportGift'>, 
                     beatmap=None)
tybug commented 10 months ago

Thanks for the report! Looks like a stupid copy-paste error on my end. I'm pretty certain this will be fixed by 8e8494a0b2f389225eba3c56378552947030615b.