diff --git a/src/main/kotlin/com/featurevisor/sdk/Conditions.kt b/src/main/kotlin/com/featurevisor/sdk/Conditions.kt index 922d3ab..d5d39e9 100644 --- a/src/main/kotlin/com/featurevisor/sdk/Conditions.kt +++ b/src/main/kotlin/com/featurevisor/sdk/Conditions.kt @@ -111,19 +111,19 @@ object Conditions { } } - conditionValue is ConditionValue.ArrayValue -> { - val valueInContext = (context[attributeKey] as? AttributeValue.StringValue)?.value + attributeValue is AttributeValue.IntValue && conditionValue is ConditionValue.ArrayValue -> { when (operator) { - IN_ARRAY -> valueInContext in conditionValue.values - NOT_IN_ARRAY -> valueInContext !in conditionValue.values + IN_ARRAY -> attributeValue.value.toString() in conditionValue.values + NOT_IN_ARRAY -> (attributeValue.value.toString() !in conditionValue.values) else -> false } } - attributeValue is AttributeValue.IntValue && conditionValue is ConditionValue.ArrayValue -> { + conditionValue is ConditionValue.ArrayValue -> { + val valueInContext = (context[attributeKey] as? AttributeValue.StringValue)?.value when (operator) { - IN_ARRAY -> attributeValue.value.toString() in conditionValue.values - NOT_IN_ARRAY -> (attributeValue.value.toString() !in conditionValue.values) + IN_ARRAY -> valueInContext in conditionValue.values + NOT_IN_ARRAY -> valueInContext !in conditionValue.values else -> false } }