Skip to content

Commit 58b8d58

Browse files
bernardodemarcodhslove
authored andcommitted
fix npe on account creation (apache#10274)
1 parent e2a2939 commit 58b8d58

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
@@ -1382,7 +1382,7 @@ protected void validateRoleChange(Account account, Role role, Account caller) {
13821382
*/
13831383
private void checkRoleEscalation(Account caller, Account requested) {
13841384
if (logger.isDebugEnabled()) {
1385-
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]",
1385+
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]",
13861386
caller.getAccountName(),
13871387
caller.getUuid(),
13881388
caller.getRoleId(),
@@ -1396,12 +1396,13 @@ private void checkRoleEscalation(Account caller, Account requested) {
13961396
checkApiAccess(apiCheckers, requested, command);
13971397
} catch (PermissionDeniedException pde) {
13981398
if (logger.isTraceEnabled()) {
1399-
logger.trace(String.format("checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
1399+
logger.trace(String.format(
1400+
"Checking for permission to \"%s\" is irrelevant as it is not requested for %s [%s]",
14001401
command,
1401-
pde.getAccount().getAccountName(),
1402-
pde.getAccount().getUuid(),
1403-
pde.getEntitiesInViolation()
1404-
));
1402+
requested.getAccountName(),
1403+
requested.getUuid()
1404+
)
1405+
);
14051406
}
14061407
continue;
14071408
}

0 commit comments

Comments
 (0)