mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 05:22:26 +08:00
[Java] Fix the issue when waiting an empty list or a null pointer (#3632)
This commit is contained in:
@@ -50,6 +50,11 @@ public class RayletClientImpl implements RayletClient {
|
||||
@Override
|
||||
public <T> WaitResult<T> wait(List<RayObject<T>> waitFor, int numReturns, int
|
||||
timeoutMs, UniqueId currentTaskId) {
|
||||
Preconditions.checkNotNull(waitFor);
|
||||
if (waitFor.isEmpty()) {
|
||||
return new WaitResult<>(new ArrayList<>(), new ArrayList<>());
|
||||
}
|
||||
|
||||
List<UniqueId> ids = new ArrayList<>();
|
||||
for (RayObject<T> element : waitFor) {
|
||||
ids.add(element.getId());
|
||||
|
||||
Reference in New Issue
Block a user