File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -378,6 +378,10 @@ else if (isDocument(value)) {
378378 }
379379 }
380380
381+ if (value == null ) {
382+ return null ;
383+ }
384+
381385 if (isNestedKeyword (value )) {
382386 return getMappedKeyword (new Keyword ((Bson ) value ), documentField .getPropertyEntity ());
383387 }
@@ -635,7 +639,7 @@ public Object convertId(@Nullable Object id, Class<?> targetType) {
635639 * @param candidate
636640 * @return
637641 */
638- protected boolean isNestedKeyword (Object candidate ) {
642+ protected boolean isNestedKeyword (@ Nullable Object candidate ) {
639643
640644 if (!(candidate instanceof Document )) {
641645 return false ;
@@ -683,6 +687,7 @@ protected boolean isKeyword(String candidate) {
683687 * @param value the actual value. Can be {@literal null}.
684688 * @return the potentially converted target value.
685689 */
690+ @ Nullable
686691 private Object applyFieldTargetTypeHintToValue (Field documentField , @ Nullable Object value ) {
687692
688693 if (value == null || documentField .getProperty () == null || !documentField .getProperty ().hasExplicitWriteTarget ()) {
You can’t perform that action at this time.
0 commit comments