Skip to content

Commit 18d87d6

Browse files
committed
Return empty map instead of null when the property is a map
Signed-off-by: Shawn Kovalchick <[email protected]>
1 parent 99afe1d commit 18d87d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/ReferenceLookupDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public ReferenceLookupDelegate(
116116
}
117117

118118
if (!result.iterator().hasNext()) {
119-
return null;
119+
return property.isMap() ? Collections.emptyMap() : null;
120120
}
121121

122122
Object resultValue = result.iterator().next();

0 commit comments

Comments
 (0)