DEV: Ensure censorFn copes with null regexpList (#17754)

This fixes the test suite failures introduced by 862007fb18
This commit is contained in:
David Taylor
2022-08-02 11:09:51 +01:00
committed by GitHub
parent d3e8442937
commit 4bf9b73296

View File

@@ -4,7 +4,7 @@ import {
} from "discourse-common/utils/watched-words";
export function censorFn(regexpList, replacementLetter) {
if (regexpList.length) {
if (regexpList?.length) {
replacementLetter = replacementLetter || "■";
let censorRegexps = regexpList.map((regexp) => {
return createWatchedWordRegExp(toWatchedWord(regexp));