Added missing null check for metadata.

See #2716
Closes #2897
This commit is contained in:
Jens Schauder
2023-04-18 10:25:14 +02:00
parent 9fae43d85b
commit 393fa635bd

View File

@@ -309,7 +309,7 @@ public class SimpleJpaRepository<T, ID> implements JpaRepositoryImplementation<T
getQueryHints().withFetchGraphs(em).forEach(hints::put);
if (metadata.getComment() != null && provider.getCommentHintKey() != null) {
if (metadata != null && metadata.getComment() != null && provider.getCommentHintKey() != null) {
hints.put(provider.getCommentHintKey(), provider.getCommentHintValue(metadata.getComment()));
}