summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Moliavko <o.moliavko@samsung.com>2019-06-03 09:45:32 +0300
committerOleksandr Moliavko <o.moliavko@samsung.com>2019-06-05 10:08:10 +0300
commitae776a1394b7edc9c42db471b48b330d6789643b (patch)
tree74e5a1e5434961f4ce171815d334a597470e696e
parentfbcac9be97567ca19b1018861d1ab37d2dea769f (diff)
Fixed deref of null object at error message
Issue-ID: AAF-837 Change-Id: Ied689ca30d0949e92a92b723fc77f417ade5f0e8 Signed-off-by: AlexMolyavko <o.moliavko@samsung.com>
-rw-r--r--auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java
index 690ffa08..43e121ac 100644
--- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java
+++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java
@@ -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",