From f31685e4e751bda589773bf9f997d2056b35e146 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 11 Oct 2020 00:15:09 +0200 Subject: [PATCH] fix some exceptions due to None values --- csdr/csdr.py | 2 ++ owrx/dsp.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/csdr/csdr.py b/csdr/csdr.py index 84b1fef..aed322d 100644 --- a/csdr/csdr.py +++ b/csdr/csdr.py @@ -643,6 +643,8 @@ class dsp(object): return self.samp_rate / self.fft_fps / self.fft_averages def set_offset_freq(self, offset_freq): + if offset_freq is None: + return self.offset_freq = offset_freq if self.running: self.pipes["shift_pipe"].write("%g\n" % (-float(self.offset_freq) / self.samp_rate)) diff --git a/owrx/dsp.py b/owrx/dsp.py index ed63f8c..72e6667 100644 --- a/owrx/dsp.py +++ b/owrx/dsp.py @@ -72,6 +72,8 @@ class DspManager(csdr.output, SdrSourceEventClient): self.dsp.set_bpf(*bpf) def set_dial_freq(key, value): + if self.props["center_freq"] is None or self.props["offset_freq"] is None: + return freq = self.props["center_freq"] + self.props["offset_freq"] for parser in self.parsers.values(): parser.setDialFrequency(freq)