You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java
+6-2
Original file line number
Diff line number
Diff line change
@@ -2006,12 +2006,16 @@ protected static class ConversionContext {
2006
2006
/**
2007
2007
* Converts a source object into {@link TypeInformation target}.
2008
2008
*
2009
-
* @param source must not be {@literal null}.
2009
+
* @param source can be {@literal null}.
2010
2010
* @param typeHint must not be {@literal null}.
2011
2011
* @return the converted object.
2012
2012
*/
2013
2013
@SuppressWarnings("unchecked")
2014
-
public <SextendsObject> Sconvert(Objectsource, TypeInformation<? extendsS> typeHint) {
2014
+
public <SextendsObject> Sconvert(@NullableObjectsource, TypeInformation<? extendsS> typeHint) {
2015
+
2016
+
if(source == null) {
2017
+
returnnull;
2018
+
}
2015
2019
2016
2020
Assert.notNull(typeHint, "TypeInformation must not be null");
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java
0 commit comments