Merged 5.2.N (5.2.1) to HEAD (5.2)

129194 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      129050 jvonka: V1 REST API: fix 500 (NPE) when trying to get a version (info or content) for a node that has no version history
      REPO-1051, REPO-327, REPO-229


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129368 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:16:49 +00:00
parent 5fd392b1ce
commit 6722deffbf
2 changed files with 26 additions and 1 deletions

View File

@@ -282,6 +282,11 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
private Version findVersion(String nodeId, String versionLabelId)
{
NodeRef nodeRef = nodes.validateOrLookupNode(nodeId, null);
return versionService.getVersionHistory(nodeRef).getVersion(versionLabelId);
VersionHistory vh = versionService.getVersionHistory(nodeRef);
if (vh != null)
{
return vh.getVersion(versionLabelId);
}
return null;
}
}