From f496ff1489aac4ecbe27746d12c3fdaa73a77a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20De=20Marco=20Gon=C3=A7alves?= Date: Sat, 25 Jan 2025 19:05:25 -0300 Subject: [PATCH] fix npe on account creation --- .../java/com/cloud/user/AccountManagerImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/com/cloud/user/AccountManagerImpl.java b/server/src/main/java/com/cloud/user/AccountManagerImpl.java index 1e727036d565..9a7cbc0032ec 100644 --- a/server/src/main/java/com/cloud/user/AccountManagerImpl.java +++ b/server/src/main/java/com/cloud/user/AccountManagerImpl.java @@ -1341,7 +1341,7 @@ protected void validateRoleChange(Account account, Role role, Account caller) { */ 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 @@ private void checkRoleEscalation(Account caller, Account requested) { 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; }