Skip to content

The Free Software Media System - Server Backend & API

Change Guid.Parse to Guid.TryParse

Mister Rajoy4cc3b938fa79
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs
index 449f8872fd..b5d95134bd 100644
--- a/Emby.Server.Implementations/Collections/CollectionManager.cs
+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs
@@ -348,11 +348,13 @@ namespace Emby.Server.Implementations.Collections
foreach (var child in item.GetMediaSources(true))
{
- if (results.ContainsKey(Guid.Parse(child.Id)))
+ if (Guid.TryParse(child.Id, out var id) && results.ContainsKey(id))
{
alreadyInResults = true;
+ break;
}
}
+
if (!alreadyInResults)
{