Skip to content

Commit 7ed1580

Browse files
committed
Forgot to revert a line after local testing.
1 parent ad7101e commit 7ed1580

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/apache/ibatis/binding/MapperMethod.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ public Object execute(SqlSession sqlSession, Object[] args) {
8484
} else {
8585
Object param = method.convertArgsToSqlCommandParam(args);
8686
result = sqlSession.selectOne(command.getName(), param);
87-
if (method.returnsOptional()) {
87+
if (method.returnsOptional() &&
88+
(result == null || !method.getReturnType().equals(result.getClass()))) {
8889
result = OptionalUtil.ofNullable(result);
8990
}
9091
}

0 commit comments

Comments
 (0)