Guard against potential NPE.

Original Pull Request: #4463
This commit is contained in:
Mark Paluch
2023-08-31 08:49:06 +02:00
committed by Christoph Strobl
parent 501a1cce39
commit ea07e83552

View File

@@ -811,7 +811,7 @@ class QueryOperations {
Document mappedQuery = super.getMappedQuery(domainType);
if (multi && update.isIsolated() && !mappedQuery.containsKey("$isolated")) {
if (multi && update != null && update.isIsolated() && !mappedQuery.containsKey("$isolated")) {
mappedQuery.put("$isolated", 1);
}
@@ -907,7 +907,7 @@ class QueryOperations {
if (persistentEntity != null && persistentEntity.hasVersionProperty()) {
String versionFieldName = persistentEntity.getRequiredVersionProperty().getFieldName();
if (!update.modifies(versionFieldName)) {
if (update != null && !update.modifies(versionFieldName)) {
update.inc(versionFieldName);
}
}