Browse Source

fix comment

Looly 6 years ago
parent
commit
8040a4d33c

+ 2 - 1
hutool-http/src/main/java/cn/hutool/http/HttpRequest.java

@@ -288,7 +288,8 @@ public class HttpRequest extends HttpBase<HttpRequest> {
 	}
 
 	/**
-	 * 获取{@link HttpConnection}
+	 * 获取{@link HttpConnection}<br>
+	 * 在{@link #execute()} 执行前此对象为null
 	 * 
 	 * @return {@link HttpConnection}
 	 * @since 4.2.2

+ 7 - 3
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java

@@ -289,11 +289,15 @@ public class ExcelBase<T extends ExcelBase<T>> implements Closeable {
 	 * </pre>
 	 * 
 	 * @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;
 	}
 	
 	/**