Skip to content

Commit

Permalink
Use Arg#check
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Sep 15, 2023
1 parent 91f0b57 commit 5cc2ac8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ public Socket tunnel(
Args.notNull(proxy, "Proxy host");
Args.notNull(target, "Target host");
Args.notNull(credentials, "Credentials");
if (target.getPort() <= 0) {
throw new IllegalArgumentException("A valid port number must be provided for the tunnel CONNECT request.");
}
Args.check(target.getPort() > 0, "A valid port number must be provided for the tunnel CONNECT request.");

final HttpRoute route = new HttpRoute(
target,
null,
Expand Down

0 comments on commit 5cc2ac8

Please sign in to comment.