Fixed: Null exception due to resharper refactoring

Fixes #2947
pull/2948/head
Leonardo Galli 6 years ago
parent 409be45a19
commit b7e35fada8

@ -1,24 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ContentModelStore"> <component name="ContentModelStore">
<e p="E:\C++ Projects\Sonarr\_output" t="ExcludeRecursive"> <e p="$PROJECT_DIR$/../_output" t="ExcludeRecursive">
<e p="NzbDrone.Update" t="ExcludeRecursive" /> <e p="NzbDrone.Update" t="ExcludeRecursive" />
</e> </e>
<e p="E:\C++ Projects\Sonarr\Logo\1024.png" t="Include" /> <e p="$PROJECT_DIR$/../Logo/1024.png" t="Include" />
<e p="E:\C++ Projects\Sonarr\Logo\64.png" t="Include" /> <e p="$PROJECT_DIR$/../Logo/64.png" t="Include" />
<e p="E:\C++ Projects\Sonarr\src" t="IncludeFlat"> <e p="$PROJECT_DIR$" t="IncludeFlat">
<e p=".nuget" t="Include"> <e p=".nuget" t="Include">
<e p="NuGet.exe" t="Include" /> <e p="NuGet.exe" t="Include" />
</e> </e>
<e p="_ReSharper.Caches\ReSharperHost11.NzbDrone.00" t="ExcludeRecursive" /> <e p="_ReSharper.Caches/ReSharperHost12.NzbDrone.00" t="ExcludeRecursive" />
<e p="Common" t="Include"> <e p="Common/CommonAssemblyInfo.cs" t="Include" />
<e p="CodeAnalysisDictionary.xml" t="Include" /> <e p="Common/CommonVersionInfo.cs" t="Include" />
<e p="CommonAssemblyInfo.cs" t="Include" /> <e p="Common/GlobalSuppressions.cs" t="Include" />
<e p="CommonVersionInfo.cs" t="Include" />
<e p="GlobalSuppressions.cs" t="Include" />
</e>
<e p="External" t="Include" /> <e p="External" t="Include" />
<e p="ExternalModules\CurlSharp\CurlSharp" t="IncludeRecursive"> <e p="ExternalModules/CurlSharp/CurlSharp" t="IncludeRecursive">
<e p="bin" t="ExcludeRecursive" /> <e p="bin" t="ExcludeRecursive" />
<e p="Callbacks" t="Include"> <e p="Callbacks" t="Include">
<e p="CurlEasyCallbacks.cs" t="Include" /> <e p="CurlEasyCallbacks.cs" t="Include" />
@ -70,10 +67,10 @@
</e> </e>
</e> </e>
<e p="Host" t="Include" /> <e p="Host" t="Include" />
<e p="Libraries\MediaInfo\libmediainfo.0.dylib" t="Include" /> <e p="Libraries/MediaInfo/libmediainfo.0.dylib" t="Include" />
<e p="Libraries\MediaInfo\MediaInfo.dll" t="Include" /> <e p="Libraries/MediaInfo/MediaInfo.dll" t="Include" />
<e p="Libraries\Sqlite\libsqlite3.0.dylib" t="Include" /> <e p="Libraries/Sqlite/libsqlite3.0.dylib" t="Include" />
<e p="Libraries\Sqlite\sqlite3.dll" t="Include" /> <e p="Libraries/Sqlite/sqlite3.dll" t="Include" />
<e p="LogentriesCore" t="IncludeRecursive"> <e p="LogentriesCore" t="IncludeRecursive">
<e p="AsyncLogger.cs" t="Include" /> <e p="AsyncLogger.cs" t="Include" />
<e p="bin" t="ExcludeRecursive" /> <e p="bin" t="ExcludeRecursive" />
@ -3328,7 +3325,7 @@
</e> </e>
<e p="packages" t="ExcludeRecursive" /> <e p="packages" t="ExcludeRecursive" />
<e p="Platform" t="Include" /> <e p="Platform" t="Include" />
<e p="ServiceHelpers\ServiceInstall" t="IncludeRecursive"> <e p="ServiceHelpers/ServiceInstall" t="IncludeRecursive">
<e p="app.config" t="Include" /> <e p="app.config" t="Include" />
<e p="app.manifest" t="Include" /> <e p="app.manifest" t="Include" />
<e p="green_puzzle.ico" t="Include" /> <e p="green_puzzle.ico" t="Include" />
@ -3340,7 +3337,7 @@
<e p="ServiceHelper.cs" t="Include" /> <e p="ServiceHelper.cs" t="Include" />
<e p="ServiceInstall.csproj" t="IncludeRecursive" /> <e p="ServiceInstall.csproj" t="IncludeRecursive" />
</e> </e>
<e p="ServiceHelpers\ServiceUninstall" t="IncludeRecursive"> <e p="ServiceHelpers/ServiceUninstall" t="IncludeRecursive">
<e p="app.config" t="Include" /> <e p="app.config" t="Include" />
<e p="app.manifest" t="Include" /> <e p="app.manifest" t="Include" />
<e p="obj" t="ExcludeRecursive" /> <e p="obj" t="ExcludeRecursive" />

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
@ -46,13 +47,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search
var requiredFlags = torrentIndexerSettings.RequiredFlags; var requiredFlags = torrentIndexerSettings.RequiredFlags;
var requiredFlag = (IndexerFlags) 0; var requiredFlag = (IndexerFlags) 0;
var enumerable = requiredFlags.ToList(); if (requiredFlags == null || !requiredFlags.Any())
if (requiredFlags == null || !enumerable.Any())
{ {
return Decision.Accept(); return Decision.Accept();
} }
foreach (var flag in enumerable) foreach (var flag in requiredFlags)
{ {
if (torrentInfo.IndexerFlags.HasFlag((IndexerFlags)flag)) if (torrentInfo.IndexerFlags.HasFlag((IndexerFlags)flag))
{ {

Loading…
Cancel
Save