feat:内部添加对自定义铭感词和白名单词为null的判断,防止出现类似Issue#72的错误

This commit is contained in:
ZWH266183351
2024-08-27 21:14:46 +08:00
parent c121bce3d2
commit beb8b5229b
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);
}