From: Jonathan Gathman Date: Wed, 3 Jul 2019 14:08:19 +0000 (+0000) Subject: Merge "Fixed deref of null object at error message" X-Git-Tag: 2.1.15~23 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=commitdiff_plain;h=078325f8ef05a6216292f5331ef0805a5bdd9ef1;hp=-c Merge "Fixed deref of null object at error message" --- 078325f8ef05a6216292f5331ef0805a5bdd9ef1 diff --combined auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java index 3fde5123,43e121ac..c59312c0 --- 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 +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", @@@ -1055,8 -1060,8 +1060,8 @@@ } else if (!fullperm.roles.isEmpty()) { return Result .err(Status.ERR_DependencyExists, - "Permission [%s.%s|%s|%s] cannot be deleted as it is attached to 1 or more roles.", - fullperm.ns, fullperm.type, fullperm.instance, fullperm.action); + "Permission [%s] cannot be deleted as it is attached to 1 or more roles.", + fullperm.fullPerm()); } }