mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-20 20:50:36 +02:00
Resolve Possible null reference
This commit is contained in:
parent
97f8a63b89
commit
3928d02e17
|
@ -37,7 +37,11 @@ namespace Jellyfin.Api.Helpers
|
||||||
|
|
||||||
foreach (var provider in foundLyricProviders)
|
foreach (var provider in foundLyricProviders)
|
||||||
{
|
{
|
||||||
providerList.Add((ILyricsProvider)Activator.CreateInstance(provider));
|
ILyricsProvider? newProvider = Activator.CreateInstance(provider) as ILyricsProvider;
|
||||||
|
if (newProvider is not null)
|
||||||
|
{
|
||||||
|
providerList.Add(newProvider);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ILyricsProvider provider in providerList)
|
foreach (ILyricsProvider provider in providerList)
|
||||||
|
@ -74,7 +78,7 @@ namespace Jellyfin.Api.Helpers
|
||||||
// Iterate over all found lyric providers
|
// Iterate over all found lyric providers
|
||||||
foreach (var provider in foundLyricProviders)
|
foreach (var provider in foundLyricProviders)
|
||||||
{
|
{
|
||||||
var foundProvider = (ILyricsProvider)Activator.CreateInstance(provider);
|
ILyricsProvider? foundProvider = Activator.CreateInstance(provider) as ILyricsProvider;
|
||||||
if (foundProvider?.FileExtensions is null)
|
if (foundProvider?.FileExtensions is null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue