aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-03-03 17:24:58 +0100
committerGitHub <noreply@github.com>2021-03-03 17:24:58 +0100
commitddc62a89bab6b5a1ecdee7a9ebc7f9d5887d8be8 (patch)
tree72574b2350b3ea090d3df9550f229506e1dce191 /MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
parentd819a1d92827f6a8c8b3b5289a4ca306a9f098ed (diff)
parent8b72b902f53b32c0c0d69eeda3bd32f992ac53ee (diff)
Merge pull request #5356 from cvium/fix_provideridextensions
return false when providerid is null or empty
Diffstat (limited to 'MediaBrowser.Model/Entities/ProviderIdsExtensions.cs')
-rw-r--r--MediaBrowser.Model/Entities/ProviderIdsExtensions.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
index bde5a1da1..09d14dc6a 100644
--- a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
+++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
@@ -22,7 +22,7 @@ namespace MediaBrowser.Model.Entities
throw new ArgumentNullException(nameof(instance));
}
- return instance.ProviderIds?.ContainsKey(name) ?? false;
+ return instance.TryGetProviderId(name, out _);
}
/// <summary>
@@ -56,7 +56,15 @@ namespace MediaBrowser.Model.Entities
return false;
}
- return instance.ProviderIds.TryGetValue(name, out id);
+ var foundProviderId = instance.ProviderIds.TryGetValue(name, out id);
+ // This occurs when searching with Identify (and possibly in other places)
+ if (string.IsNullOrEmpty(id))
+ {
+ id = null;
+ foundProviderId = false;
+ }
+
+ return foundProviderId;
}
/// <summary>