diff --git a/src/main/java/io/harness/cf/client/api/Evaluator.java b/src/main/java/io/harness/cf/client/api/Evaluator.java index 31b44462..4209338a 100644 --- a/src/main/java/io/harness/cf/client/api/Evaluator.java +++ b/src/main/java/io/harness/cf/client/api/Evaluator.java @@ -67,7 +67,7 @@ protected Optional findVariation( static int getNormalizedNumber(@NonNull Object property, @NonNull String bucketBy) { byte[] value = String.join(":", bucketBy, property.toString()).getBytes(); long hasher = Murmur3.hash_x86_32(value, value.length, 0); - int result = (int) (hasher % Evaluator.ONE_HUNDRED) + 1; + int result = (int) (hasher % ONE_HUNDRED) + 1; log.debug("normalized number for {} = {}", new String(value), result); return result; } @@ -78,6 +78,8 @@ protected boolean isEnabled(Target target, String bucketBy, int percentage) { String oldBB = bucketBy; bucketBy = "identifier"; attrValue = getAttrValue(target, bucketBy); + + if (!attrValue.isPresent()) { return false; }