Skip to content

Commit a24eb42

Browse files
committed
Fix NPE when using password in Properties
Signed-off-by: John Eberhard <[email protected]>
1 parent 94a4eb2 commit a24eb42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/main/java/com/ibm/as400/access/AS400JDBCDataSource.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -3832,9 +3832,11 @@ else if (JDProperties.isToolboxTraceSet(newProperties, null) == JDProperties.TRA
38323832
else if (propIndex == JDProperties.USER)
38333833
setUser(propertyValue);
38343834
else if (propIndex == JDProperties.PASSWORD) {
3835-
char[] clearPassword = properties_.getClearPassword();
3835+
char[] clearPassword = propertyValue.toCharArray();
38363836
setPassword(clearPassword);
38373837
CredentialVault.clearArray(clearPassword);
3838+
if (JDTrace.isTraceOn())
3839+
JDTrace.logInformation (this, "Use of password property not recommended: using setPassword(char[]) instead");
38383840
} else if (propIndex == JDProperties.SECURE)
38393841
setSecure(propertyValue.equals(TRUE_) ? true : false);
38403842
else if (propIndex == JDProperties.KEEP_ALIVE)

0 commit comments

Comments
 (0)