diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java index 3ecca5bde..a15c7b6bc 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceController.java @@ -77,6 +77,7 @@ * @author Jon Brisbin * @author Oliver Gierke * @author Greg Turnquist + * @author Brandon Vulaj */ @RepositoryRestController @SuppressWarnings({ "unchecked" }) @@ -318,7 +319,7 @@ public ResponseEntity> createPropertyReference( "Cannot PATCH a reference to this singular property since the property type is not a List or a Map."); } - if (source.getLinks().hasSingleLink()) { + if (!source.getLinks().hasSingleLink()) { throw new IllegalArgumentException( "Must send only 1 link to update a property reference that isn't a List or a Map."); }