diff --git a/spring-data-rest-repository/src/main/java/org/springframework/data/rest/repository/support/RepositoryEntityLinks.java b/spring-data-rest-repository/src/main/java/org/springframework/data/rest/repository/support/RepositoryEntityLinks.java index e295a5370..c6b56d982 100644 --- a/spring-data-rest-repository/src/main/java/org/springframework/data/rest/repository/support/RepositoryEntityLinks.java +++ b/spring-data-rest-repository/src/main/java/org/springframework/data/rest/repository/support/RepositoryEntityLinks.java @@ -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.");