Skip to content

Add a null-check to the ids argument in the stopPlaces Transmodel API endpoint. #6556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: dev-2.x
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,13 @@ private GraphQLSchema create() {
.build()
)
.dataFetcher(env -> {
if (env.getArgument("ids") != null) {
var ids = mapIDsToDomainNullSafe(env.getArgument("ids"));
return ids
.stream()
.map(id -> StopPlaceType.fetchStopPlaceById(id, env))
.collect(Collectors.toList());
if (env.getArgument("ids") == null) {
throw new IllegalArgumentException("ids argument must be set to a non-null value.");
}
TransitService transitService = GqlUtil.getTransitService(env);
return transitService
.listStations()
var ids = mapIDsToDomainNullSafe(env.getArgument("ids"));
return ids
.stream()
.map(station ->
new MonoOrMultiModalStation(station, transitService.findMultiModalStation(station))
)
.map(id -> StopPlaceType.fetchStopPlaceById(id, env))
.collect(Collectors.toList());
})
.build()
Expand Down
Loading