From 75ad921624f1355999dadfe0fcd1ceff77b1444c Mon Sep 17 00:00:00 2001 From: Fabian Munkes <105975993+fmunkes@users.noreply.github.com> Date: Fri, 7 Nov 2025 11:46:01 +0100 Subject: [PATCH] fix: MusicCast - non-existing player in zone handling (#2606) --- music_assistant/providers/musiccast/player.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/music_assistant/providers/musiccast/player.py b/music_assistant/providers/musiccast/player.py index 433ae2a2..33feb825 100644 --- a/music_assistant/providers/musiccast/player.py +++ b/music_assistant/providers/musiccast/player.py @@ -336,7 +336,9 @@ class MusicCastPlayer(Player): # verify that this source actually exists and is non net _allowed_sources = self._get_allowed_sources_zone_switch(zone_player) mass_player = self.mass.players.get(player_id) - assert mass_player is not None + if mass_player is None: + # Do not assert here, should the player not yet exist + return if _source not in _allowed_sources: msg = ( "The switch source you specified for " -- 2.34.1