Skip to content

Commit

Permalink
Make sure not to send empty requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanuszkiewicz-tt committed Jul 5, 2024
1 parent 7e80929 commit e9f3283
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.net.URI;
import java.security.Permission;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;

Expand Down Expand Up @@ -51,6 +52,10 @@ public ProtoFetcher(URI uri, String id, String key, Supplier<Permission> permiss
}

public List<Integer> getTimes(Coordinates origin, List<Coordinates> destinations, int limit, Transportation mode, Country country, RequestType requestType) {
if(destinations.isEmpty()) {
return Collections.emptyList();
}

val fastProto =
TimeFilterFastProtoRequest
.builder()
Expand Down

0 comments on commit e9f3283

Please sign in to comment.