diff --git a/CHANGELOG.md b/CHANGELOG.md index 19f547c88..779fdec9e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * ### 🐞Bug修复 * 【extra 】 修复createExtractor中抛出异常后流未关闭问题(pr#2384@Github) +* 【core 】 修复CsvData.getHeader没有判空导致空指针问题(issue#I5CK7Q@Gitee) ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvData.java b/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvData.java index 1bf31a92e..bd852ad69 100755 --- a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvData.java +++ b/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvData.java @@ -42,6 +42,9 @@ public class CsvData implements Iterable, Serializable { * @return the header row - might be {@code null} if no header exists */ public List getHeader() { + if(null == this.header){ + return null; + } return Collections.unmodifiableList(this.header); }