Skip to content

WOR-1389 fix npe #126

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

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Changes from all commits
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 @@ -14,6 +14,7 @@
import jakarta.ws.rs.ext.Provider;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -87,7 +88,8 @@ public String getHttpRequestMethod(ClientRequestContext clientRequestContext) {
@Override
public List<String> getHttpRequestHeader(
ClientRequestContext clientRequestContext, String name) {
return clientRequestContext.getStringHeaders().get(name);
return Objects.requireNonNullElse(
clientRequestContext.getStringHeaders().get(name), List.of());
}

@Nullable
Expand All @@ -104,7 +106,7 @@ public List<String> getHttpResponseHeader(
ClientRequestContext clientRequestContext,
ClientResponseContext clientResponseContext,
String name) {
return clientResponseContext.getHeaders().get(name);
return Objects.requireNonNullElse(clientResponseContext.getHeaders().get(name), List.of());
}
}
}