Fix /injury roll command crash when player.team is None

The search_players() API endpoint returns team as an ID only (not nested object),
causing player.team to be None. Added null check before accessing team.thumbnail.

Fixes AttributeError: 'NoneType' object has no attribute 'thumbnail'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-02-04 21:50:43 -06:00
parent 6935465210
commit ab8bfa115f
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
2.29.2
2.29.3

View File

@ -139,7 +139,7 @@ class InjuryGroup(app_commands.Group):
embed = EmbedTemplate.warning(
title=f"Injury roll for {interaction.user.name}"
)
if player.team.thumbnail is not None:
if player.team and player.team.thumbnail:
embed.set_thumbnail(url=player.team.thumbnail)
embed.add_field(