Skip to content

Commit 28fc1e4

Browse files
committed
Polishing.
Use ObjectUtils for empty check. See #3623 Original pull request: #3625.
1 parent d62639d commit 28fc1e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/AggregationUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.springframework.expression.spel.standard.SpelExpressionParser;
4040
import org.springframework.lang.Nullable;
4141
import org.springframework.util.ClassUtils;
42+
import org.springframework.util.ObjectUtils;
4243
import org.springframework.util.StringUtils;
4344

4445
/**
@@ -198,7 +199,7 @@ static void appendLimitAndOffsetIfPresent(List<AggregationOperation> aggregation
198199
@Nullable
199200
static <T> T extractSimpleTypeResult(@Nullable Document source, Class<T> targetType, MongoConverter converter) {
200201

201-
if (source == null || source.isEmpty()) {
202+
if (ObjectUtils.isEmpty(source)) {
202203
return null;
203204
}
204205

0 commit comments

Comments
 (0)