diff --git a/src/main/java/com/github/houbb/sensitive/word/support/allow/WordAllowInit.java b/src/main/java/com/github/houbb/sensitive/word/support/allow/WordAllowInit.java index 6803637..a7c5f92 100644 --- a/src/main/java/com/github/houbb/sensitive/word/support/allow/WordAllowInit.java +++ b/src/main/java/com/github/houbb/sensitive/word/support/allow/WordAllowInit.java @@ -34,6 +34,9 @@ public abstract class WordAllowInit implements IWordAllow { List wordAllows = pipeline.list(); for (IWordAllow wordAllow : wordAllows) { List allowList = wordAllow.allow(); + if (allowList == null) { + allowList = new ArrayList<>(); + } results.addAll(allowList); } diff --git a/src/main/java/com/github/houbb/sensitive/word/support/deny/WordDenyInit.java b/src/main/java/com/github/houbb/sensitive/word/support/deny/WordDenyInit.java index 0fa64c2..6aa67cf 100644 --- a/src/main/java/com/github/houbb/sensitive/word/support/deny/WordDenyInit.java +++ b/src/main/java/com/github/houbb/sensitive/word/support/deny/WordDenyInit.java @@ -35,6 +35,9 @@ public abstract class WordDenyInit implements IWordDeny { List wordDenies = pipeline.list(); for (IWordDeny wordDeny : wordDenies) { List denyList = wordDeny.deny(); + if (denyList == null) { + denyList = new ArrayList<>(); + } results.addAll(denyList); }