File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/optimizely-sdk/lib/core/custom_attribute_condition_evaluator Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ type Condition = {
41
41
name : string ;
42
42
type : string ;
43
43
match ?: string ;
44
- value : string | number | boolean ;
44
+ value : string | number | boolean | null ;
45
45
}
46
46
47
47
type ConditionEvaluator = ( condition : Condition , userAttributes : UserAttributes ) => boolean | null ;
@@ -180,7 +180,7 @@ function greaterThanEvaluator(condition: Condition, userAttributes: UserAttribut
180
180
const userValueType = typeof userValue ;
181
181
const conditionValue = condition . value ;
182
182
183
- if ( ! isSafeInteger ( conditionValue ) ) {
183
+ if ( conditionValue === null || ! isSafeInteger ( conditionValue ) ) {
184
184
logger . warn (
185
185
LOG_MESSAGES . UNEXPECTED_CONDITION_VALUE , MODULE_NAME , JSON . stringify ( condition )
186
186
) ;
@@ -227,7 +227,7 @@ function lessThanEvaluator(condition: Condition, userAttributes: UserAttributes)
227
227
const userValueType = typeof userValue ;
228
228
const conditionValue = condition . value ;
229
229
230
- if ( ! isSafeInteger ( conditionValue ) ) {
230
+ if ( conditionValue === null || ! isSafeInteger ( conditionValue ) ) {
231
231
logger . warn (
232
232
LOG_MESSAGES . UNEXPECTED_CONDITION_VALUE , MODULE_NAME , JSON . stringify ( condition )
233
233
) ;
You can’t perform that action at this time.
0 commit comments