fix: MusicCast - non-existing player in zone handling (#2606)
authorFabian Munkes <105975993+fmunkes@users.noreply.github.com>
Fri, 7 Nov 2025 10:46:01 +0000 (11:46 +0100)
committerGitHub <noreply@github.com>
Fri, 7 Nov 2025 10:46:01 +0000 (11:46 +0100)
music_assistant/providers/musiccast/player.py

index 433ae2a2cb95587071ecbdbee72950cb44d345c9..33feb82552c13b9337218feceda74d8a391d5b36 100644 (file)
@@ -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 "