cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
544 stars 183 forks source link

League object fails to instantiate when not all teams of league have managers #534

Closed tylerastraub closed 3 months ago

tylerastraub commented 3 months ago

Sport

Basketball

Summary

We had a member of our league drop all his players during playoffs so I removed his access to the league by removing his email from the league members page. When I went to run our power rankings program this morning, it suddenly stopped working. Adding in a dummy email for the team got everything to run smoothly again. If this is intended, then please close this, but I'm not sure why every team needs to have a team owner for the API to work. See attached image below for the error:

Logs/Data

image

cwendt94 commented 3 months ago

That is a bug, thanks for reporting. The get and default to single object in array was suppose to prevent that but I am guessing the owners field is present just an empty array. I will look into fixing this.

cwendt94 commented 3 months ago

Oh looks like this was fixed in the latest version https://github.com/cwendt94/espn-api/pull/519!