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 @@ -445,6 +445,10 @@ else if (isDocument(value)) {
445445 }
446446 }
447447
448+ if (value == null ) {
449+ return null ;
450+ }
451+
448452 if (isNestedKeyword (value )) {
449453 return getMappedKeyword (new Keyword ((Bson ) value ), documentField .getPropertyEntity ());
450454 }
@@ -711,7 +715,7 @@ public Object convertId(@Nullable Object id, Class<?> targetType) {
711715 * @param candidate
712716 * @return
713717 */
714- protected boolean isNestedKeyword (Object candidate ) {
718+ protected boolean isNestedKeyword (@ Nullable Object candidate ) {
715719
716720 if (!(candidate instanceof Document )) {
717721 return false ;
@@ -759,6 +763,7 @@ protected boolean isKeyword(String candidate) {
759763 * @param value the actual value. Can be {@literal null}.
760764 * @return the potentially converted target value.
761765 */
766+ @ Nullable
762767 private Object applyFieldTargetTypeHintToValue (Field documentField , @ Nullable Object value ) {
763768
764769 if (value == null || documentField .getProperty () == null || !documentField .getProperty ().hasExplicitWriteTarget ()) {
You can’t perform that action at this time.
0 commit comments