From 7e88a002b6ca40fc85fde993282b8706f140d9aa Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 7 Oct 2025 13:03:04 +0200 Subject: [PATCH] fix(waveform): safeguard for if scan_item is a list --- bec_widgets/widgets/plots/waveform/waveform.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bec_widgets/widgets/plots/waveform/waveform.py b/bec_widgets/widgets/plots/waveform/waveform.py index b13c9f9f..94cf8d5e 100644 --- a/bec_widgets/widgets/plots/waveform/waveform.py +++ b/bec_widgets/widgets/plots/waveform/waveform.py @@ -2095,6 +2095,12 @@ class Waveform(PlotBase): if scan_item is None: logger.warning(f"Scan with scan_number {scan_index} not found in history.") return None + if isinstance(scan_item, list): + if len(scan_item) > 1: + logger.warning( + f"Multiple scans found with scan_number {scan_index}. Returning the latest one." + ) + scan_item = scan_item[-1] return scan_item @SafeSlot(int)