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