mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-03 20:27:58 +08:00
fix NPE bug
This commit is contained in:
parent
aaa88dad81
commit
8196941b6e
@ -25,6 +25,7 @@
|
||||
* 【core 】 修复urlWithParamIfGet函数逻辑问题(issue#I50IUD@Gitee)
|
||||
* 【core 】 修复IoUtil.readBytes限制长度读取问题(issue#2230@Github)
|
||||
* 【http 】 修复HttpRequest中编码对URL无效的问题(issue#I50NHQ@Gitee)
|
||||
* 【poi 】 修复读取excel抛NPE错误(pr#2234@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -260,7 +260,6 @@ public class HandleHelper {
|
||||
* 获取字段值<br>
|
||||
* 针对日期时间等做单独处理判断
|
||||
*
|
||||
* @param <T> 返回类型
|
||||
* @param rs {@link ResultSet}
|
||||
* @param columnIndex 字段索引
|
||||
* @param type 字段类型,默认Object
|
||||
@ -268,7 +267,7 @@ public class HandleHelper {
|
||||
* @return 字段值
|
||||
* @throws SQLException SQL异常
|
||||
*/
|
||||
private static <T> Object getColumnValue(ResultSet rs, int columnIndex, int type, Type targetColumnType) throws SQLException {
|
||||
private static Object getColumnValue(ResultSet rs, int columnIndex, int type, Type targetColumnType) throws SQLException {
|
||||
Object rawValue = null;
|
||||
switch (type) {
|
||||
case Types.TIMESTAMP:
|
||||
|
@ -245,9 +245,9 @@ public class ExcelReadTest {
|
||||
Assert.assertEquals("", objects.get(2));
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
@Ignore
|
||||
@Test
|
||||
public void readColumnNPETest() {
|
||||
// https://github.com/dromara/hutool/pull/2234
|
||||
ExcelReader reader = ExcelUtil.getReader(ResourceUtil.getStream("read_row_npe.xlsx"));
|
||||
reader.readColumn(0, 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user