Build fix for NPE in QueryTest

java.lang.NullPointerException
	at org.alfresco.opencmis.mapping.AllowedChildObjectTypeIdsProperty.getValueInternal(AllowedChildObjectTypeIdsProperty.java:56)
	at org.alfresco.opencmis.mapping.AbstractProperty.getValue(AbstractProperty.java:102)
	at org.alfresco.opencmis.search.CmisFunctionEvaluationContext.getProperty(CmisFunctionEvaluationContext.java:215)
	at org.alfresco.repo.search.impl.querymodel.impl.BasePropertyArgument.getValue(BasePropertyArgument.java:75)
	at org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor.getValue(PropertyAccessor.java:74)
	at org.alfresco.opencmis.search.CMISResultSetRow.getValue(CMISResultSetRow.java:174)
	at org.alfresco.opencmis.search.QueryTest.testBasicAllFolderColumns(QueryTest.java:3531)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2011-11-17 19:38:50 +00:00
parent 10bd3e40dc
commit df4dd4c094

View File

@@ -53,6 +53,11 @@ public class AllowedChildObjectTypeIdsProperty extends AbstractProperty
@Override
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
if(nodeInfo.getType() == null)
{
return (Serializable) Collections.emptyList();
}
TypeDefinition type = getServiceRegistry().getDictionaryService()
.getType(nodeInfo.getType().getAlfrescoClass());
if ((type != null) && (type.getChildAssociations() != null) && (!type.getChildAssociations().isEmpty()))