@@ -41,7 +41,11 @@ internal fun comparePropWithConditionValue(prop: UserProperty, asType: UserPrope
4141 }
4242 UserPropertyType .SEMVER -> {
4343 val strings = values.map { it.trim() }
44- compareSemver(a = prop.value, b = strings, op = op)
44+ if (strings.all { it.isNotEmpty() }) {
45+ compareSemver(a = prop.value, b = strings, op = op)
46+ } else {
47+ false
48+ }
4549 }
4650 UserPropertyType .TIMESTAMPZ -> {
4751 val propValue = parseTimestampSeconds(prop.value)
@@ -54,10 +58,15 @@ internal fun comparePropWithConditionValue(prop: UserProperty, asType: UserPrope
5458 }
5559 UserPropertyType .BOOLEAN -> {
5660 val propValue = parseStringToBoolean(prop.value)
57- val conditionValues = values.map {
58- parseStringToBoolean(it)
61+ val strings = values.map { it.trim() }
62+ if (strings.all { it.isNotEmpty() }) {
63+ val conditionValues = strings.map {
64+ parseStringToBoolean(it)
65+ }
66+ compareBoolean(propValue, conditionValues, op)
67+ } else {
68+ false
5969 }
60- compareBoolean(propValue, conditionValues, op)
6170 }
6271 else -> false
6372 }
@@ -95,7 +104,7 @@ internal fun compareInteger(a: Long, b: List<Long>, op: ConditionOperator): Bool
95104
96105
97106internal fun compareLong (a : Long , b : List <Long >, op : ConditionOperator ): Boolean {
98- return when (op) {
107+ when (op) {
99108 ConditionOperator .Equal -> {
100109 if (b.isEmpty()) {
101110 return false
@@ -154,7 +163,7 @@ internal fun compareLong(a: Long, b: List<Long>, op: ConditionOperator): Boolean
154163}
155164
156165internal fun compareDouble (a : Double , b : List <Double >, op : ConditionOperator ): Boolean {
157- return when (op) {
166+ when (op) {
158167 ConditionOperator .Equal -> {
159168 if (b.isEmpty()) {
160169 return false
@@ -214,7 +223,7 @@ internal fun compareDouble(a: Double, b: List<Double>, op: ConditionOperator): B
214223
215224
216225internal fun compareString (a : String , b : List <String >, op : ConditionOperator ): Boolean {
217- return when (op) {
226+ when (op) {
218227 ConditionOperator .Regex -> {
219228 if (b.isEmpty()) {
220229 return false
@@ -279,7 +288,7 @@ internal fun compareString(a: String, b: List<String>, op: ConditionOperator): B
279288}
280289
281290internal fun compareBoolean (a : Boolean , b : List <Boolean >, op : ConditionOperator ): Boolean {
282- return when (op) {
291+ when (op) {
283292 ConditionOperator .Equal -> {
284293 if (b.isEmpty()) {
285294 return false
@@ -309,7 +318,7 @@ internal fun compareBoolean(a: Boolean, b: List<Boolean>, op: ConditionOperator)
309318
310319
311320internal fun compareSemver (a : String , b : List <String >, op : ConditionOperator ): Boolean {
312- return when (op) {
321+ when (op) {
313322 ConditionOperator .Equal -> {
314323 if (b.isEmpty()) {
315324 return false
0 commit comments