Skip to content

Commit 06265b1

Browse files
update: handle nil variation_id in get_variation method
1 parent 64353a9 commit 06265b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/optimizely/decision_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def get_variation(project_config, experiment_id, user_context, user_profile_trac
134134
cmab_decision = cmab_decision_result.result
135135
variation_id = cmab_decision&.variation_id
136136
cmab_uuid = cmab_decision&.cmab_uuid
137-
variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id)
137+
variation = variation_id ? project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id) : nil
138138
else
139139
# Bucket normally
140140
variation, bucket_reasons = @bucketer.bucket(project_config, experiment, bucketing_id, user_id)

0 commit comments

Comments
 (0)