From d1991b33003a4294d6f5fcdb000844e7c4169be3 Mon Sep 17 00:00:00 2001 From: goodboy Date: Fri, 30 Jan 2026 19:21:28 -0500 Subject: [PATCH] Guard against `None` chart in `ArrowEditor.remove()` Add null check for `linked.chart` before calling `.plotItem.removeItem()` to prevent `AttributeError` when chart is `None`. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- piker/ui/_editors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piker/ui/_editors.py b/piker/ui/_editors.py index f8d3e68c..872ec910 100644 --- a/piker/ui/_editors.py +++ b/piker/ui/_editors.py @@ -174,7 +174,10 @@ class ArrowEditor(Struct): f'{arrow!r}\n' ) for linked in self.godw.iter_linked(): - linked.chart.plotItem.removeItem(arrow) + if not (chart := linked.chart): + continue + + chart.plotItem.removeItem(arrow) try: arrows.remove(arrow) except ValueError: