mirror of https://github.com/lidarr/Lidarr
Better way to fix empty string split results
This commit is contained in:
parent
885872ff3a
commit
6cbc8687de
|
@ -37,12 +37,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var restrictions = restrictionsString.Split('\n');
|
var restrictions = restrictionsString.Split(new []{ '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
foreach (var restriction in restrictions)
|
foreach (var restriction in restrictions)
|
||||||
{
|
{
|
||||||
if (String.IsNullOrWhiteSpace(restriction)) continue;
|
|
||||||
|
|
||||||
if (subject.Release.Title.ToLowerInvariant().Contains(restriction.ToLowerInvariant()))
|
if (subject.Release.Title.ToLowerInvariant().Contains(restriction.ToLowerInvariant()))
|
||||||
{
|
{
|
||||||
_logger.Trace("{0} is restricted: {1}", subject, restriction);
|
_logger.Trace("{0} is restricted: {1}", subject, restriction);
|
||||||
|
|
Loading…
Reference in New Issue