From ae776a1394b7edc9c42db471b48b330d6789643b Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Mon, 3 Jun 2019 09:45:32 +0300 Subject: Fixed deref of null object at error message Issue-ID: AAF-837 Change-Id: Ied689ca30d0949e92a92b723fc77f417ade5f0e8 Signed-off-by: AlexMolyavko --- .../auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'auth') 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", -- cgit 1.2.3-korg