return false when providerid is null or empty

pull/5356/head
cvium 3 years ago
parent 8f99bdd07c
commit 664c5da317

@ -50,13 +50,15 @@ namespace MediaBrowser.Model.Entities
throw new ArgumentNullException(nameof(instance));
}
if (instance.ProviderIds == null)
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;
return false;
foundProviderId = false;
}
return instance.ProviderIds.TryGetValue(name, out id);
return foundProviderId;
}
/// <summary>

@ -869,14 +869,14 @@ namespace MediaBrowser.Providers.Manager
}
}
}
catch (Exception)
#pragma warning disable CA1031 // do not catch general exception types
catch (Exception ex)
#pragma warning restore CA1031 // do not catch general exception types
{
// Logged at lower levels
_logger.LogError(ex, "Provider {ProviderName} failed to retrieve search results", provider.Name);
}
}
// _logger.LogDebug("Returning search results {0}", _json.SerializeToString(resultList));
return resultList;
}

Loading…
Cancel
Save