Backport pull request #12037 from jellyfin/release-10.9.z

Do not fail user deletion if we have no playlist folder

Original-merge: d90f504ca7

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Shadowghost 2024-06-23 11:40:46 -04:00 committed by Joshua M. Boniface
parent b0f2135762
commit 529d24ec30

View file

@ -170,8 +170,13 @@ namespace Emby.Server.Implementations.Playlists
private List<Playlist> GetUserPlaylists(Guid userId)
{
var user = _userManager.GetUserById(userId);
var playlistsFolder = GetPlaylistsFolder(userId);
if (playlistsFolder is null)
{
return [];
}
return GetPlaylistsFolder(userId).GetChildren(user, true).OfType<Playlist>().ToList();
return playlistsFolder.GetChildren(user, true).OfType<Playlist>().ToList();
}
private static string GetTargetPath(string path)