Skip to content

Commit

Permalink
Merge pull request #312 from evil0th/master
Browse files Browse the repository at this point in the history
🐛修复无参构造validator无默认值导致NPE的问题
  • Loading branch information
evil0th authored May 8, 2024
2 parents 0900399 + e9d4361 commit 93a287f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.List;

import javax.validation.Validation;
import javax.validation.Validator;

import com.alibaba.excel.event.AnalysisEventListener;
Expand All @@ -37,7 +38,7 @@ public abstract class ListAnalysisEventListener<T> extends AnalysisEventListener
/**
* 校验器
*/
private Validator validator;
private Validator validator = Validation.buildDefaultValidatorFactory().getValidator();

/**
* 获取 excel 解析的对象列表
Expand Down

0 comments on commit 93a287f

Please sign in to comment.