Skip to content

Commit

Permalink
Add guard for token sniffer score
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuh25 committed Feb 11, 2025
1 parent 9327e2e commit 53c53a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tradingstrategy/token_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def token_sniffer_score(self) -> int | None:
if self.token_sniffer_data is None:
return None

return self.token_sniffer_data["score"]
return self.token_sniffer_data.get("score")

def get_coingecko_categories(self) -> set[str] | None:
"""Get CoinGecko categories of this token.
Expand Down
2 changes: 1 addition & 1 deletion tradingstrategy/top.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def token_sniffer_score(self) -> int | None:
if self.token_sniffer_data is None:
return None

return self.token_sniffer_data["score"]
return self.token_sniffer_data.get("score")

def has_tax_data(self) -> bool | None:
"""Do we have tax data for this pair.
Expand Down

0 comments on commit 53c53a6

Please sign in to comment.