From f346444ec39db6d61aceb58cae01de8eac322b7e Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sat, 22 Aug 2026 08:08:27 +0100 Subject: [PATCH] Defensive coding improvements --- providers/spot/dxcluster.py | 3 ++- providers/spot/rbn.py | 3 ++- templates/add_spot.html | 2 +- templates/alerts.html | 2 +- templates/bands.html | 4 ++-- templates/base.html | 10 +++++----- templates/conditions.html | 2 +- templates/map.html | 4 ++-- templates/spots.html | 4 ++-- templates/status.html | 2 +- 10 files changed, 19 insertions(+), 17 deletions(-) diff --git a/providers/spot/dxcluster.py b/providers/spot/dxcluster.py index f8904f1..5cbe78f 100644 --- a/providers/spot/dxcluster.py +++ b/providers/spot/dxcluster.py @@ -50,7 +50,8 @@ class DXCluster(SpotProvider): def stop(self): self._running = False - self._telnet.close() + if self._telnet: + self._telnet.close() self._thread.join() def _handle(self): diff --git a/providers/spot/rbn.py b/providers/spot/rbn.py index 684f278..6b26238 100644 --- a/providers/spot/rbn.py +++ b/providers/spot/rbn.py @@ -39,7 +39,8 @@ class RBN(SpotProvider): def stop(self): self._running = False - self._telnet.close() + if self._telnet: + self._telnet.close() self._thread.join() def _handle(self): diff --git a/templates/add_spot.html b/templates/add_spot.html index f95f7a0..954eaf3 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index a870701..534a9bb 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -84,7 +84,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index afbd820..555a618 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 805ca75..e2a081a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -15,10 +15,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 6783858..5c7bdbc 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 7e15a82..eb22735 100644 --- a/templates/map.html +++ b/templates/map.html @@ -109,8 +109,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 55d676c..1fa7561 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -113,8 +113,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index a62d0df..8468e25 100644 --- a/templates/status.html +++ b/templates/status.html @@ -86,7 +86,7 @@ - +