mirror of
https://github.com/houbb/sensitive-word.git
synced 2026-03-22 08:27:36 +08:00
Merge pull request #75 from NBHZW/master
feat:内部添加对自定义铭感词和白名单词为null的判断,防止出现类似Issue#72的错误
This commit is contained in:
@@ -34,6 +34,9 @@ public abstract class WordAllowInit implements IWordAllow {
|
||||
List<IWordAllow> wordAllows = pipeline.list();
|
||||
for (IWordAllow wordAllow : wordAllows) {
|
||||
List<String> allowList = wordAllow.allow();
|
||||
if (allowList == null) {
|
||||
allowList = new ArrayList<>();
|
||||
}
|
||||
results.addAll(allowList);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ public abstract class WordDenyInit implements IWordDeny {
|
||||
List<IWordDeny> wordDenies = pipeline.list();
|
||||
for (IWordDeny wordDeny : wordDenies) {
|
||||
List<String> denyList = wordDeny.deny();
|
||||
if (denyList == null) {
|
||||
denyList = new ArrayList<>();
|
||||
}
|
||||
results.addAll(denyList);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user