Skip to content

Fix AttributeError in maybe_archive_idle_post when post is missing#3498

Open
oliveman-au wants to merge 1 commit intopython-discord:mainfrom
oliveman-au:fix/help-channel-attributeerror-on-missing-post
Open

Fix AttributeError in maybe_archive_idle_post when post is missing#3498
oliveman-au wants to merge 1 commit intopython-discord:mainfrom
oliveman-au:fix/help-channel-attributeerror-on-missing-post

Conversation

@oliveman-au
Copy link
Copy Markdown

When get_or_fetch_channel raises discord.HTTPException, the except block references post and post.id — but post was never assigned since the exception occurred before the assignment completed. This causes an AttributeError: 'int' object has no attribute 'id', meaning the error handler itself crashes instead of recovering gracefully.

Fixed by replacing post and post.id with post_id in the log line, which is the integer that was passed into the function.

@L3viathan
Copy link
Copy Markdown
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants