1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-05 00:12:49 +01:00

fix(waveform): safeguard for if scan_item is a list

This commit is contained in:
2025-10-07 13:03:04 +02:00
committed by Jan Wyzula
parent 20a59af648
commit 7e88a002b6

View File

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