Skip to content

Commit 2ec18d0

Browse files
Apply suggestion from @abh1sar
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
1 parent ff826f9 commit 2ec18d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5521,7 +5521,8 @@ public void finalizeExpunge(VirtualMachine vm) {
55215521
}
55225522

55235523
private void checkForceStopVmPermission(Account callingAccount) {
5524-
if (callingAccount == null || !AllowUserForceStopVm.valueIn(callingAccount.getId())) {
5524+
callingAccountId = callingAccount == null ? null : callingAccount.getId();
5525+
if (!AllowUserForceStopVm.valueIn(callingAccountId)) {
55255526
logger.error("Parameter [{}] can only be passed by Admin accounts or when the allow.user.force.stop.vm config is true for the account.", ApiConstants.FORCED);
55265527
throw new PermissionDeniedException("Account does not have the permission to force stop the vm.");
55275528
}

0 commit comments

Comments
 (0)