[Fix] Fixed broken tests
This commit is contained in:
parent
af78eb4ac8
commit
492b556089
|
@ -1722,7 +1722,7 @@ public class DefaultPrivilegeHandler implements PrivilegeHandler {
|
|||
}
|
||||
|
||||
PasswordCrypt userPasswordCrypt = user.getPasswordCrypt();
|
||||
if (userPasswordCrypt.getPassword() == null)
|
||||
if (userPasswordCrypt == null || userPasswordCrypt.getPassword() == null)
|
||||
throw new InvalidCredentialsException(format("User {0} has no password and may not login!", username));
|
||||
|
||||
// we only work with hashed passwords
|
||||
|
|
|
@ -149,6 +149,9 @@ public class PrivilegeUsersDomWriter {
|
|||
|
||||
private void writePassword(User user, Element userElement) {
|
||||
PasswordCrypt passwordCrypt = user.getPasswordCrypt();
|
||||
if (passwordCrypt == null)
|
||||
return;
|
||||
|
||||
String passwordString = passwordCrypt.buildPasswordString();
|
||||
if (passwordString != null) {
|
||||
userElement.setAttribute(XML_ATTR_PASSWORD, passwordString);
|
||||
|
|
Loading…
Reference in New Issue