From 63b2908eb2fb3586e7ae9423036031ec31ea90b2 Mon Sep 17 00:00:00 2001 From: jupfi Date: Wed, 22 May 2024 12:42:20 +0200 Subject: [PATCH] Fixed bug with crashing UI if no measurement data could be retrieved. --- src/nqrduck_spectrometer_limenqr/controller.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nqrduck_spectrometer_limenqr/controller.py b/src/nqrduck_spectrometer_limenqr/controller.py index dabbe5c..8c4ff98 100644 --- a/src/nqrduck_spectrometer_limenqr/controller.py +++ b/src/nqrduck_spectrometer_limenqr/controller.py @@ -58,6 +58,10 @@ class LimeNQRController(BaseSpectrometerController): measurement_data = self.process_measurement_results(lime) + if not measurement_data: + self.emit_measurement_error("Measurement failed. Unable to retrieve data.") + return -1 + # Resample the RX data to the dwell time settings dwell_time = self.module.model.get_setting_by_name( self.module.model.RX_DWELL_TIME