From 10dfe3811b47a852ece36f23247d6fc40d72f580 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Fri, 24 Nov 2023 08:43:34 +0100 Subject: [PATCH] context_processors: prevent a null station error when no default station is defined --- aircox/context_processors/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aircox/context_processors/__init__.py b/aircox/context_processors/__init__.py index e79119a..7147c88 100644 --- a/aircox/context_processors/__init__.py +++ b/aircox/context_processors/__init__.py @@ -1,3 +1,4 @@ def station(request): station = request.station - return {"station": station, "audio_streams": station.streams} + audio_streams = station.streams if station else None + return {"station": station, "audio_streams": audio_streams}