fix npe on account creation (#10274)

This commit is contained in:
Bernardo De Marco Gonçalves 2025-01-30 11:52:36 -03:00 committed by GitHub
parent d9af9bdb36
commit c70e4e29be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1341,7 +1341,7 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
*/
private void checkRoleEscalation(Account caller, Account requested) {
if (s_logger.isDebugEnabled()) {
s_logger.debug(String.format("checking if user of account %s [%s] with role-id [%d] can create an account of type %s [%s] with role-id [%d]",
s_logger.debug(String.format("Checking if user of account %s [%s] with role-id [%d] can create an account of type %s [%s] with role-id [%d]",
caller.getAccountName(),
caller.getUuid(),
caller.getRoleId(),
@ -1355,12 +1355,13 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
checkApiAccess(apiCheckers, requested, command);
} catch (PermissionDeniedException pde) {
if (s_logger.isTraceEnabled()) {
s_logger.trace(String.format("checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
s_logger.trace(String.format(
"Checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
command,
pde.getAccount().getAccountName(),
pde.getAccount().getUuid(),
pde.getEntitiesInViolation()
));
requested.getAccountName(),
requested.getUuid()
)
);
}
continue;
}