Skip to content

Commit

Permalink
update URIBuilder.getFirstQueryParam: do a null check instead of crea…
Browse files Browse the repository at this point in the history
…ting empty list
  • Loading branch information
skssxf committed Dec 19, 2023
1 parent c4ec335 commit 0a6ea67
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ public List<NameValuePair> getQueryParams() {
* @since 5.2
*/
public NameValuePair getFirstQueryParam(final String name) {
return getQueryParams().stream().filter(e -> name.equals(e.getName())).findFirst().orElse(null);
if (this.queryParams == null) return null;
return queryParams.stream().filter(e -> name.equals(e.getName())).findFirst().orElse(null);
}

/**
Expand Down

0 comments on commit 0a6ea67

Please sign in to comment.