Skip to content

Commit

Permalink
Fix : In array condition is failing when attribute value is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Tan108 committed Dec 4, 2024
1 parent 9630444 commit 4363697
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/com/featurevisor/sdk/Conditions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ object Conditions {
}
}

attributeValue is AttributeValue.StringValue && conditionValue is ConditionValue.ArrayValue -> {
conditionValue is ConditionValue.ArrayValue -> {
val valueInContext = (context[attributeKey] as? AttributeValue.StringValue)?.value
when (operator) {
IN_ARRAY -> attributeValue.value in conditionValue.values
NOT_IN_ARRAY -> (attributeValue.value !in conditionValue.values)
IN_ARRAY -> valueInContext in conditionValue.values
NOT_IN_ARRAY -> valueInContext !in conditionValue.values
else -> false
}
}
Expand Down

0 comments on commit 4363697

Please sign in to comment.