Skip to content

Commit 75ad921

Browse files
authored
fix: MusicCast - non-existing player in zone handling (#2606)
1 parent 2acadec commit 75ad921

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

music_assistant/providers/musiccast/player.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ async def _handle_zone_grouping(self, zone_player: MusicCastZoneDevice) -> None:
336336
# verify that this source actually exists and is non net
337337
_allowed_sources = self._get_allowed_sources_zone_switch(zone_player)
338338
mass_player = self.mass.players.get(player_id)
339-
assert mass_player is not None
339+
if mass_player is None:
340+
# Do not assert here, should the player not yet exist
341+
return
340342
if _source not in _allowed_sources:
341343
msg = (
342344
"The switch source you specified for "

0 commit comments

Comments
 (0)