Merge pull request #75 from NBHZW/master

feat:内部添加对自定义铭感词和白名单词为null的判断,防止出现类似Issue#72的错误
This commit is contained in:
老马啸西风
2024-08-28 08:41:28 +08:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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);
}