Skip to content

Commit

Permalink
[Destiny] Handle missing NextPaginationToken in news articles
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Feb 6, 2024
1 parent 7e4c0c1 commit effe513
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion destiny/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def save_id(self) -> str:
@dataclass
class NewsArticles:
CurrentPaginationToken: int
NextPaginationToken: int
ResultCountThisPage: int
NewsArticles: List[NewsArticle]
PagerAction: str
NextPaginationToken: Optional[int] = None
CategoryFilter: Optional[str] = None

@classmethod
Expand Down
3 changes: 3 additions & 0 deletions destiny/destiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ async def news_checker(self):
except Destiny2APIError as e:
log.error("Error checking Destiny news sources: %s", e)
return
except Exception:
log.exception("Error Checking Destiny news sources")
return
if len(news.NewsArticles) < 1:
return
source = BungieNewsSource(news)
Expand Down

0 comments on commit effe513

Please sign in to comment.