Browse Source

Guard against Item.view being None when dispatching

pull/10367/head
Rapptz 7 months ago
parent
commit
0052878983
  1. 7
      discord/ui/view.py

7
discord/ui/view.py

@ -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)

Loading…
Cancel
Save