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:
parent
6935465210
commit
ab8bfa115f
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user