Guard against Item.view being None when dispatching

This commit is contained in:
Rapptz
2025-12-21 12:18:05 -05:00
parent 9be91cb093
commit 0052878983

View File

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