mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-07 17:39:03 +00:00
Guard against Item.view being None when dispatching
This commit is contained in:
1 parent
9be91cb093
commit
0052878983
1 file changed
+5
-2
+5
-2
@@ -1027,8 +1027,11 @@ class ViewStore:
|
||||
if item is None:
|
||||
return
|
||||
|
||||
# Note, at this point the View is *not* None
|
||||
task = item.view._dispatch_item(item, interaction) # type: ignore
|
||||
if item.view is None:
|
||||
_log.warning('View interaction referencing unknown view for item %s. Discarding', item)
|
||||
return
|
||||
|
||||
task = item.view._dispatch_item(item, interaction)
|
||||
if task is not None:
|
||||
self.add_task(task)
|
||||
|
||||
|
||||
Reference in new issue
Block a user