Repository: cloudstack
Updated Branches:
  refs/heads/4.5 6321a29e4 -> aca0f7959


CLOUDSTACK-8072: Fixed NPE in deleting default ACL items in default ACL


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aca0f795
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aca0f795
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aca0f795

Branch: refs/heads/4.5
Commit: aca0f7959274d4cc3d6a8a727c65977952d66dce
Parents: 6321a29
Author: Jayapal <jaya...@apache.org>
Authored: Mon Dec 15 15:41:30 2014 +0530
Committer: Jayapal <jaya...@apache.org>
Committed: Mon Dec 15 16:44:08 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aca0f795/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java 
b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 51bb71f..bee4018 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -612,13 +612,14 @@ public class NetworkACLServiceImpl extends ManagerBase 
implements NetworkACLServ
 
             Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId());
 
+            if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || 
(aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){
+                throw new InvalidParameterValueException("ACL Items in default 
ACL cannot be deleted");
+            }
+
             Account caller = CallContext.current().getCallingAccount();
 
             _accountMgr.checkAccess(caller, null, true, vpc);
 
-            if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || 
(aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){
-                throw new InvalidParameterValueException("ACL Items in default 
ACL cannot be deleted");
-            }
         }
         return _networkAclMgr.revokeNetworkACLItem(ruleId);
     }

Reply via email to