diff --git a/nhlpy/api/schedule.py b/nhlpy/api/schedule.py index 5528f00..e7bca3a 100644 --- a/nhlpy/api/schedule.py +++ b/nhlpy/api/schedule.py @@ -22,10 +22,10 @@ def get_schedule(self, date: str = None) -> dict: schedule_data: dict = self.client.get(resource=f"schedule/{date}").json() response_payload = { - "nextStartDate": schedule_data["nextStartDate"], - "previousStartDate": schedule_data["previousStartDate"], + "nextStartDate": schedule_data.get("nextStartDate", None), + "previousStartDate": schedule_data.get("previousStartDate", None), "date": date, - "oddsPartners": schedule_data["oddsPartners"], + "oddsPartners": schedule_data.get("oddsPartners", None), } matching_day = next((day for day in schedule_data["gameWeek"] if day["date"] == date), None) diff --git a/pyproject.toml b/pyproject.toml index 57bdc60..cde3e4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "nhl-api-py" -version = "2.12.0" +version = "2.12.1" description = "NHL API (Updated for 2024/2025) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats." authors = ["Corey Schaf "] readme = "README.md"