Fixed deref of null object at error message 19/89119/2
authorOleksandr Moliavko <o.moliavko@samsung.com>
Mon, 3 Jun 2019 06:45:32 +0000 (09:45 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Wed, 5 Jun 2019 07:08:10 +0000 (10:08 +0300)
Issue-ID: AAF-837
Change-Id: Ied689ca30d0949e92a92b723fc77f417ade5f0e8
Signed-off-by: AlexMolyavko <o.moliavko@samsung.com>
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java

index 690ffa0..43e121a 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",