[Fix] Fixed broken tests

This commit is contained in:
Robert von Burg 2023-09-10 00:32:24 +02:00
parent af78eb4ac8
commit 492b556089
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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);