Skip to content

Commit edfa297

Browse files
committed
fix npe on ContainerConfig.getExposedPorts
1 parent 7c8740e commit edfa297

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/github/dockerjava/api/model/ContainerConfig.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ public class ContainerConfig {
8181

8282
@JsonIgnore
8383
public ExposedPort[] getExposedPorts() {
84-
return exposedPorts.getExposedPorts();
84+
if (exposedPorts == null) {
85+
return new ExposedPort[0];
86+
} else {
87+
return exposedPorts.getExposedPorts();
88+
}
8589
}
8690

8791
public boolean isNetworkDisabled() {

0 commit comments

Comments
 (0)