Fix NPE in set-project-parent command if parent is not specified
If for the set-project-parent command the new parent project is not specified by default the root project 'All-Projects' should become the new parent. Currently it fails with a NullPointerException. Change-Id: Ibb46a1e41cd237dfe2abf80de97b20aa2970c89f Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -117,8 +117,9 @@ final class AdminSetParent extends BaseCommand {
|
||||
MetaDataUpdate md = metaDataUpdateFactory.create(key);
|
||||
try {
|
||||
ProjectConfig config = ProjectConfig.read(md);
|
||||
config.getProject().setParentName(newParentKey.get());
|
||||
md.setMessage("Inherit access from " + newParentKey.get() + "\n");
|
||||
config.getProject().setParentName(newParentKey);
|
||||
md.setMessage("Inherit access from "
|
||||
+ (newParentKey != null ? newParentKey.get() : allProjectsName.get()) + "\n");
|
||||
if (!config.commit(md)) {
|
||||
err.append("error: Could not update project " + name + "\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user