File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/Microsoft.FeatureManagement/FeatureFilters Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 4
4
using Microsoft . Extensions . Configuration ;
5
5
using Microsoft . Extensions . Logging ;
6
6
using Microsoft . FeatureManagement . Utils ;
7
+ using System ;
7
8
using System . Threading . Tasks ;
8
9
9
10
namespace Microsoft . FeatureManagement . FeatureFilters
@@ -43,6 +44,11 @@ public object BindParameters(IConfiguration filterParameters)
43
44
/// <returns>True if the feature is enabled, false otherwise.</returns>
44
45
public Task < bool > EvaluateAsync ( FeatureFilterEvaluationContext context )
45
46
{
47
+ if ( context == null )
48
+ {
49
+ throw new ArgumentNullException ( nameof ( context ) ) ;
50
+ }
51
+
46
52
//
47
53
// Check if prebound settings available, otherwise bind from parameters.
48
54
PercentageFilterSettings settings = ( PercentageFilterSettings ) context . Settings ?? ( PercentageFilterSettings ) BindParameters ( context . Parameters ) ;
Original file line number Diff line number Diff line change @@ -43,6 +43,11 @@ public object BindParameters(IConfiguration filterParameters)
43
43
/// <returns>True if the feature is enabled, false otherwise.</returns>
44
44
public Task < bool > EvaluateAsync ( FeatureFilterEvaluationContext context )
45
45
{
46
+ if ( context == null )
47
+ {
48
+ throw new ArgumentNullException ( nameof ( context ) ) ;
49
+ }
50
+
46
51
//
47
52
// Check if prebound settings available, otherwise bind from parameters.
48
53
TimeWindowFilterSettings settings = ( TimeWindowFilterSettings ) context . Settings ?? ( TimeWindowFilterSettings ) BindParameters ( context . Parameters ) ;
You can’t perform that action at this time.
0 commit comments