Skip to content

Commit

Permalink
Prevent System.ArgumentNullException in case switcher value is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStupka committed Nov 8, 2018
1 parent 068881d commit c21f0e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public CloudSearchDocumentBuilder(IIndexable indexable, IProviderUpdateContext c
protected override void AddComputedIndexFieldsInParallel()
{
ConcurrentQueue<Exception> exceptions = new ConcurrentQueue<Exception>();
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue;
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue ?? false;
ParallelForeachProxy.ForEach<IComputedIndexField>((IEnumerable<IComputedIndexField>)Options.ComputedIndexFields, ParallelOptions, (Action<IComputedIndexField, ParallelLoopState>)delegate (IComputedIndexField computedIndexField, ParallelLoopState parallelLoopState)
{
object fieldValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public LuceneDocumentBuilder(IIndexable indexable, IProviderUpdateContext contex
protected override void AddComputedIndexFieldsInParallel()
{
ConcurrentQueue<Exception> exceptions = new ConcurrentQueue<Exception>();
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue;
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue ?? false;
ParallelForeachProxy.ForEach<IComputedIndexField>((IEnumerable<IComputedIndexField>)Options.ComputedIndexFields, ParallelOptions, (Action<IComputedIndexField, ParallelLoopState>)delegate (IComputedIndexField computedIndexField, ParallelLoopState parallelLoopState)
{
object fieldValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public CustomSolrDocumentBuilder(IIndexable indexable, IProviderUpdateContext co
protected override void AddComputedIndexFieldsInParallel()
{
ConcurrentQueue<Exception> exceptions = new ConcurrentQueue<Exception>();
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue;
var needEnterLanguageFallbackItemSwitcher = LanguageFallbackItemSwitcher.CurrentValue ?? false;
ParallelForeachProxy.ForEach<IComputedIndexField>((IEnumerable<IComputedIndexField>)Options.ComputedIndexFields, ParallelOptions, (Action<IComputedIndexField, ParallelLoopState>)delegate (IComputedIndexField computedIndexField, ParallelLoopState parallelLoopState)
{
object fieldValue;
Expand Down

0 comments on commit c21f0e5

Please sign in to comment.