mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merge V2.2 to HEAD
ALF-1801 - Empty category array throws NPE git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19895 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -374,8 +374,16 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
ClassificationWebService.this.nodeService.addAspect(nodeRef, aspect, null);
|
ClassificationWebService.this.nodeService.addAspect(nodeRef, aspect, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<NodeRef> categoryNodeRefs = new ArrayList<NodeRef>(category.getCategories().length);
|
Reference[] categories = category.getCategories();
|
||||||
for (Reference categoryReference : category.getCategories())
|
ArrayList<NodeRef> categoryNodeRefs = null;
|
||||||
|
if(categories == null)
|
||||||
|
{
|
||||||
|
categoryNodeRefs = new ArrayList<NodeRef>(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
categoryNodeRefs = new ArrayList<NodeRef>(categories.length);
|
||||||
|
for (Reference categoryReference : categories)
|
||||||
{
|
{
|
||||||
categoryNodeRefs.add(Utils.convertToNodeRef(
|
categoryNodeRefs.add(Utils.convertToNodeRef(
|
||||||
categoryReference,
|
categoryReference,
|
||||||
@@ -383,6 +391,7 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
ClassificationWebService.this.searchService,
|
ClassificationWebService.this.searchService,
|
||||||
ClassificationWebService.this.namespaceService));
|
ClassificationWebService.this.namespaceService));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClassificationWebService.this.nodeService.setProperty(nodeRef, propertyName, categoryNodeRefs);
|
ClassificationWebService.this.nodeService.setProperty(nodeRef, propertyName, categoryNodeRefs);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user