From 482b8709a8ee2b462f7449f7472527ab7baef657 Mon Sep 17 00:00:00 2001 From: jupfi Date: Tue, 18 Jun 2024 15:37:25 +0200 Subject: [PATCH] Improved error handling. --- src/quackseq_limenqr/limenqr_controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quackseq_limenqr/limenqr_controller.py b/src/quackseq_limenqr/limenqr_controller.py index 0197d08..167b6f5 100644 --- a/src/quackseq_limenqr/limenqr_controller.py +++ b/src/quackseq_limenqr/limenqr_controller.py @@ -57,7 +57,10 @@ class LimeNQRController(SpectrometerController): dwell_time = UnitConverter.to_float(dwell_time) * 1e6 logger.debug("Dwell time: %s", dwell_time) - logger.debug(f"Last tdx value: {measurement_data.tdx[-1]}") + if not measurement_data: + return None + + logger.debug(f"Last tdx value: {measurement_data.tdx[-1][-1]}") if dwell_time: n_data_points = int(measurement_data.tdx[-1][-1] / dwell_time)