Skip to content

Commit b253f47

Browse files
authored
getVariationForFeatureInRollout to return null decisionResponse when rolloutRulesLength is zero (#423)
1 parent 56917f8 commit b253f47

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ DecisionResponse<FeatureDecision> getVariationForFeatureInRollout(@Nonnull Featu
283283

284284
// for all rules before the everyone else rule
285285
int rolloutRulesLength = rollout.getExperiments().size();
286+
if (rolloutRulesLength == 0) {
287+
return new DecisionResponse(new FeatureDecision(null, null, null), reasons);
288+
}
286289
String bucketingId = getBucketingId(userId, filteredAttributes);
287290

288291
Variation variation;

0 commit comments

Comments
 (0)