From: Fabian Munkes <105975993+fmunkes@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:46:01 +0000 (+0100) Subject: fix: MusicCast - non-existing player in zone handling (#2606) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=75ad921624f1355999dadfe0fcd1ceff77b1444c;p=music-assistant-server.git fix: MusicCast - non-existing player in zone handling (#2606) --- 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 "