File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
client/src/main/java/io/split/client/utils Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,7 @@ public static RuleBasedSegmentsToUpdate processRuleBasedSegmentChanges(RuleBased
2222 List <String > toRemove = new ArrayList <>();
2323 Set <String > segments = new HashSet <>();
2424 for (RuleBasedSegment ruleBasedSegment : ruleBasedSegments ) {
25- if (ruleBasedSegment .excluded == null )
26- {
27- ruleBasedSegment .excluded = createEmptyExcluded ();
28- }
25+ ruleBasedSegment .excluded = checkExcluded (ruleBasedSegment .excluded );
2926 if (ruleBasedSegment .status != Status .ACTIVE ) {
3027 // archive.
3128 toRemove .add (ruleBasedSegment .name );
@@ -49,4 +46,16 @@ private static Excluded createEmptyExcluded() {
4946 return excluded ;
5047 }
5148
49+ private static Excluded checkExcluded (Excluded excluded ) {
50+ if (excluded == null ) {
51+ excluded = createEmptyExcluded ();
52+ }
53+ if (excluded .segments == null ) {
54+ excluded .segments = new ArrayList <>();
55+ }
56+ if (excluded .keys == null ) {
57+ excluded .keys = new ArrayList <>();
58+ }
59+ return excluded ;
60+ }
5261}
You can’t perform that action at this time.
0 commit comments