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
committerJoshua M. Boniface <joshua@boniface.me>2021-03-06 14:27:58 -0500
commit046dd7fa60f2c539e94baf8150a2bdfb67d42e7b (patch)
treea02894b3e02ad0383cb30b61acb1e4fd14145931 /MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
parent5e18ab3604d14fc48519ab2e29d82331e5ee6f17 (diff)
Merge pull request #5356 from cvium/fix_provideridextensions
return false when providerid is null or empty (cherry picked from commit ddc62a89bab6b5a1ecdee7a9ebc7f9d5887d8be8) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
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 16e1d49c7..512a5473f 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>