Skip to content

Commit c70e4e2

Browse files
fix npe on account creation (#10274)
1 parent d9af9bd commit c70e4e2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ protected void validateRoleChange(Account account, Role role, Account caller) {
13411341
*/
13421342
private void checkRoleEscalation(Account caller, Account requested) {
13431343
if (s_logger.isDebugEnabled()) {
1344-
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]",
1344+
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]",
13451345
caller.getAccountName(),
13461346
caller.getUuid(),
13471347
caller.getRoleId(),
@@ -1355,12 +1355,13 @@ private void checkRoleEscalation(Account caller, Account requested) {
13551355
checkApiAccess(apiCheckers, requested, command);
13561356
} catch (PermissionDeniedException pde) {
13571357
if (s_logger.isTraceEnabled()) {
1358-
s_logger.trace(String.format("checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
1358+
s_logger.trace(String.format(
1359+
"Checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
13591360
command,
1360-
pde.getAccount().getAccountName(),
1361-
pde.getAccount().getUuid(),
1362-
pde.getEntitiesInViolation()
1363-
));
1361+
requested.getAccountName(),
1362+
requested.getUuid()
1363+
)
1364+
);
13641365
}
13651366
continue;
13661367
}

0 commit comments

Comments
 (0)