Skip to content

Commit 5c153dc

Browse files
committed
Polishing.
Use ObjectUtils for empty check. See #3623 Original pull request: #3625.
1 parent 8f4e207 commit 5c153dc

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
@@ -33,6 +33,7 @@
3333
import org.springframework.expression.ExpressionParser;
3434
import org.springframework.lang.Nullable;
3535
import org.springframework.util.ClassUtils;
36+
import org.springframework.util.ObjectUtils;
3637
import org.springframework.util.StringUtils;
3738

3839
/**
@@ -165,7 +166,7 @@ static void appendLimitAndOffsetIfPresent(List<AggregationOperation> aggregation
165166
@Nullable
166167
static <T> T extractSimpleTypeResult(@Nullable Document source, Class<T> targetType, MongoConverter converter) {
167168

168-
if (source == null || source.isEmpty()) {
169+
if (ObjectUtils.isEmpty(source)) {
169170
return null;
170171
}
171172

0 commit comments

Comments
 (0)