Skip to content

Commit

Permalink
add null check for safety for the input excludedServices
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitendra Dhawan committed Nov 21, 2024
1 parent df73636 commit 02af4db
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
import io.appform.ranger.core.model.ServiceRegistry;
import io.appform.ranger.core.signals.ScheduledSignal;
import io.appform.ranger.core.signals.Signal;
import java.util.HashSet;
import java.util.Set;

import java.util.*;

import lombok.val;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;

/**
Expand Down Expand Up @@ -85,7 +83,7 @@ public ServiceFinderHubBuilder<T, R> withHubStartTimeout(long hubStartTimeoutMs)
}

public ServiceFinderHubBuilder<T, R> withExcludedServices(Set<String> excludedServices) {
this.excludedServices = excludedServices;
this.excludedServices = Objects.requireNonNullElseGet(excludedServices, Set::of);
return this;
}

Expand Down

0 comments on commit 02af4db

Please sign in to comment.