Skip to content

Commit 6fa4cc0

Browse files
committed
Only override AuthConfig iff username/password/email/server address are all set
Unless this is done, it is possible to create an invalid AuthConfig with null values for password and other fields.
1 parent 64abb6f commit 6fa4cc0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ public String getDockerCfgPath() {
253253

254254
private AuthConfig getAuthConfig() {
255255
AuthConfig authConfig = null;
256-
if(getUsername() != null) {
256+
if (getUsername() != null && getPassword() != null && getEmail() != null
257+
&& getServerAddress() != null) {
257258
authConfig = new AuthConfig();
258259
authConfig.setUsername(getUsername());
259260
authConfig.setPassword(getPassword());

0 commit comments

Comments
 (0)