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 ef662f2300
commit 0348c680d1

View File

@@ -304,7 +304,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()));
}