Skip to content

Commit af27cab

Browse files
committed
Handle null JdbcMappingHint in visitObjectWrapper method
Previously, a null JdbcMappingHint could cause a NullPointerException. This fix introduces a check to ensure a default JdbcType is used if the hint is null, preventing potential runtime errors.
1 parent ee2b2b3 commit af27cab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doma-core/src/main/java/org/seasar/doma/jdbc/dialect/StandardDialect.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,12 @@ public Void visitUtilDateWrapper(
578578
@Override
579579
public Void visitObjectWrapper(ObjectWrapper wrapper, JdbcMappingFunction p, JdbcMappingHint q)
580580
throws SQLException {
581-
JdbcType<Object> jdbcType = q.getJdbcType().orElse(JdbcTypes.OBJECT);
581+
JdbcType<Object> jdbcType;
582+
if (q != null) {
583+
jdbcType = q.getJdbcType().orElse(JdbcTypes.OBJECT);
584+
} else {
585+
jdbcType = JdbcTypes.OBJECT;
586+
}
582587
return p.apply(wrapper, jdbcType);
583588
}
584589
}

0 commit comments

Comments
 (0)