Stop CurPlayer when song is not found (#855)

This commit is contained in:
McSchneidar authored and GitHub committed 2026-03-26 09:48:16 +01:00
1 parent ba3f362519
commit fd3e945aeb
1 file changed
+10 -2
+10 -2
View File
@@ -353,8 +353,16 @@ namespace Vocaluxe.Base
_CurPlayer = _BGPlayer;
if (_MusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC)
{
_CurPlayer.Load(CSongs.GetSong(_PreviewPlayer.SongID));
_CurPlayer.Position = _PreviewPlayer.Position;
var song = CSongs.GetSong(_PreviewPlayer.SongID);
if (song != null)
{
_CurPlayer.Load(song);
_CurPlayer.Position = _PreviewPlayer.Position;
}
else
{
_CurPlayer.Stop();
}
}
CSound.SetGlobalVolume(CConfig.BackgroundMusicVolume);
}