diff --git a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java b/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java index b985a795d..732477197 100644 --- a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java +++ b/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java @@ -288,7 +288,8 @@ public class HttpRequest extends HttpBase { } /** - * 获取{@link HttpConnection} + * 获取{@link HttpConnection}
+ * 在{@link #execute()} 执行前此对象为null * * @return {@link HttpConnection} * @since 4.2.2 diff --git a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java index 8e49ee757..28ff2079a 100644 --- a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java +++ b/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java @@ -289,11 +289,15 @@ public class ExcelBase> implements Closeable { * * * @param rowNum 行号 - * @return 列数 + * @return 列数,-1表示获取失败 */ public int getColumnCount(int rowNum) { - // getLastCellNum方法返回序号+1的值 - return this.sheet.getRow(rowNum).getLastCellNum(); + final Row row = this.sheet.getRow(rowNum); + if(null != row) { + // getLastCellNum方法返回序号+1的值 + return row.getLastCellNum(); + } + return -1; } /**