Closed DatGuy1 closed 1 year ago
Currently, the highlights object can be None, such as here:
highlights
>>> r = get( ... "schedule", ... { ... "sportId": 1, ... "gamePk": gamePk, ... "hydrate": "game(content(highlights(highlights)))", ... "fields": "dates,date,games,gamePk,content,highlights,items,headline,type,value,title,description,duration,playbacks,name,url", ... }, ... ) >>> >>> r {'dates': [{'date': '2023-02-25', 'games': [{'gamePk': 719386, 'content': {'highlights': {'highlights': None}}}]}]}
The change both checks for it gracefully rather than throwing a TypeError: 'NoneType' object is not subscriptable and returns an empty list rather than an empty string, to match the other return values
TypeError: 'NoneType' object is not subscriptable
This fix is published in v1.6.1
Currently, the
highlights
object can be None, such as here:The change both checks for it gracefully rather than throwing a
TypeError: 'NoneType' object is not subscriptable
and returns an empty list rather than an empty string, to match the other return values