Skip to content

Commit c484e8b

Browse files
committed
Provide empty client config if path to config is null
1 parent 13f1bab commit c484e8b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/github/dockerjava/core/DefaultDockerClientConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ public String getDockerConfigPath() {
238238
public DockerConfigFile getDockerConfig() {
239239
if (dockerConfig == null) {
240240
try {
241-
dockerConfig = DockerConfigFile.loadConfig(new File(getDockerConfigPath()));
241+
if (getDockerConfigPath() != null) {
242+
dockerConfig = DockerConfigFile.loadConfig(new File(getDockerConfigPath()));
243+
} else {
244+
dockerConfig = new DockerConfigFile();
245+
}
242246
} catch (IOException e) {
243247
throw new DockerClientException("Failed to parse docker configuration file", e);
244248
}

0 commit comments

Comments
 (0)