From 2d678e1582e9887e82bd52448ec02e709560f9f1 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 a560249d..84a1658c 100644 --- a/piker/ui/_editors.py +++ b/piker/ui/_editors.py @@ -169,7 +169,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: