Merge "Fixed deref of null object at error message"
authorJonathan Gathman <jonathan.gathman@att.com>
Wed, 3 Jul 2019 14:08:19 +0000 (14:08 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 3 Jul 2019 14:08:19 +0000 (14:08 +0000)
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java

index 3fde512..c59312c 100644 (file)
@@ -628,7 +628,12 @@ public class Function {
                 return Result.err(Status.ERR_DependencyExists, sb.toString());
             }
 
-            if (move && (parent == null || parent.type == NsType.COMPANY.type)) {
+            if (move && parent == null) {
+                return Result
+                        .err(Status.ERR_DependencyExists,
+                                "Cannot move users, roles or permissions - parent is missing.\nDelete dependencies and try again");
+            }
+            else if (move && parent.type == NsType.COMPANY.type) {
                 return Result
                         .err(Status.ERR_DependencyExists,
                                 "Cannot move users, roles or permissions to [%s].\nDelete dependencies and try again",