Fix for DATAREST-70. Added a null check before constructing a RepositoryEntityLinks.PersistentEntityLinkBuilder

This commit is contained in:
Jon Brisbin
2013-03-05 07:58:27 -06:00
parent eaf88b18e3
commit 9ac79514b7

View File

@@ -41,6 +41,9 @@ public class RepositoryEntityLinks extends AbstractEntityLinks {
@Override public LinkBuilder linkFor(Class<?> type) {
RepositoryInformation repoInfo = repositories.getRepositoryInformationFor(type);
if(null == repoInfo) {
throw new IllegalArgumentException(type + " is not managed by any repository.");
}
PersistentEntity persistentEntity = repositories.getPersistentEntity(type);
if(null == persistentEntity) {
throw new IllegalArgumentException(type + " is not managed by any repository.");