Skip to content

Commit 773dea9

Browse files
DaanHooglandabh1sar
authored andcommitted
Apply suggestion from @abh1sar
Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
1 parent 2b2d5fa commit 773dea9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

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

56065606
private void checkForceStopVmPermission(Account callingAccount) {
5607-
if (callingAccount == null || !AllowUserForceStopVm.valueIn(callingAccount.getId())) {
5607+
callingAccountId = callingAccount == null ? null : callingAccount.getId();
5608+
if (!AllowUserForceStopVm.valueIn(callingAccountId)) {
56085609
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);
56095610
throw new PermissionDeniedException("Account does not have the permission to force stop the vm.");
56105611
}

0 commit comments

Comments
 (0)