Fix Agent and CM Issues
[aaf/authz.git] / auth / auth-deforg / src / main / java / org / onap / aaf / org / DefaultOrgIdentity.java
index f1576c4..eaa4483 100644 (file)
@@ -120,10 +120,14 @@ public class DefaultOrgIdentity implements Identity {
 
     @Override
     public Identity responsibleTo() throws OrganizationException {
-        if ("".equals(identity.responsibleTo) && isFound()) { // cover the situation of Top Dog... reports to no-one.
-            return this;
+       if(isFound()) {
+               if ("".equals(identity.responsibleTo)) { // cover the situation of Top Dog... reports to no-one.
+                   return this;
+               } else {
+                   return org.getIdentity(trans, identity.responsibleTo);
+               }
         } else {
-            return org.getIdentity(trans, identity.responsibleTo);
+               throw new OrganizationException("Identity doesn't exist");
         }
     }