From c3d651da748361daa3bb1c66e0e86eb04737ab59 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 22 Jan 2024 11:20:10 -0500 Subject: [PATCH] Fixed exception when deleting SDR source twice. --- CHANGELOG.md | 1 + debian/changelog | 1 + owrx/sdr.py | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed69938..bca6b653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Added ability to delete files, when authorized. - Added locking to connector-based SDR sources. - Improved EIBI schedules display on the map. +- Fixed exception when disabling SDR source twice. - Fixed HL2 noise after HL2 first initialized. - No longer reporting AIS messages to IGATE. diff --git a/debian/changelog b/debian/changelog index 9cd22cb7..df67d17e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ openwebrx (1.2.45) bullseye jammy; urgency=low * Added ability to delete files, when authorized. * Added locking to connector-based SDR sources. * Improved EIBI schedules display on the map. + * Fixed exception when disabling SDR source twice. * Fixed HL2 noise after HL2 first initialized. * No longer reporting AIS messages to IGATE. diff --git a/owrx/sdr.py b/owrx/sdr.py index 4ba7059c..3169b9b1 100644 --- a/owrx/sdr.py +++ b/owrx/sdr.py @@ -101,16 +101,19 @@ class SourceStateHandler(SdrSourceEventClient): self.source.removeClient(self) def onFail(self): - del self.pm[self.key] + if self.key in self.pm: + del self.pm[self.key] def onDisable(self): - del self.pm[self.key] + if self.key in self.pm: + del self.pm[self.key] def onEnable(self): self.pm[self.key] = self.source def onShutdown(self): - del self.pm[self.key] + if self.key in self.pm: + del self.pm[self.key] class ActiveSdrSources(PropertyReadOnly):