From 45453d96d1ac7952368b0b74893171a8bfc6ae72 Mon Sep 17 00:00:00 2001 From: "FOLIO3PK\\muhammadnoman" Date: Mon, 15 Feb 2021 19:25:12 +0500 Subject: [PATCH] getVariationForFeatureInRollout to return null decisionResponse when rolloutRulesLength is zero --- .../main/java/com/optimizely/ab/bucketing/DecisionService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java b/core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java index 8f7eeaca5..c6a267f5b 100644 --- a/core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java +++ b/core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java @@ -283,6 +283,9 @@ DecisionResponse getVariationForFeatureInRollout(@Nonnull Featu // for all rules before the everyone else rule int rolloutRulesLength = rollout.getExperiments().size(); + if (rolloutRulesLength == 0) { + return new DecisionResponse(new FeatureDecision(null, null, null), reasons); + } String bucketingId = getBucketingId(userId, filteredAttributes); Variation variation;