Skip to content

Commit 4bdb30d

Browse files
committed
Fix possible NPE in netty client
Signed-off-by: jansupol <jan.supol@oracle.com>
1 parent 5316536 commit 4bdb30d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyClientHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -188,6 +188,9 @@ public int read() throws IOException {
188188

189189
if (content.isReadable()) {
190190
content.retain();
191+
if (nis == null) {
192+
nis = new NettyInputStream();
193+
}
191194
nis.publish(content);
192195
}
193196

0 commit comments

Comments
 (0)