File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
core-api/src/main/java/com/optimizely/ab/config Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 23
23
import javax .annotation .Nonnull ;
24
24
import javax .annotation .Nullable ;
25
25
26
+ import java .util .Collections ;
26
27
import java .util .List ;
27
28
import java .util .Map ;
28
29
@@ -49,8 +50,13 @@ public Variation(@JsonProperty("id") String id,
49
50
@ JsonProperty ("variables" ) List <LiveVariableUsageInstance > liveVariableUsageInstances ) {
50
51
this .id = id ;
51
52
this .key = key ;
52
- this .liveVariableUsageInstances = liveVariableUsageInstances ;
53
- this .variableIdToLiveVariableUsageInstanceMap = ProjectConfigUtils .generateIdMapping (liveVariableUsageInstances );
53
+ if (liveVariableUsageInstances == null ) {
54
+ this .liveVariableUsageInstances = Collections .emptyList ();
55
+ }
56
+ else {
57
+ this .liveVariableUsageInstances = liveVariableUsageInstances ;
58
+ }
59
+ this .variableIdToLiveVariableUsageInstanceMap = ProjectConfigUtils .generateIdMapping (this .liveVariableUsageInstances );
54
60
}
55
61
56
62
public @ Nonnull String getId () {
You can’t perform that action at this time.
0 commit comments