DEV: Ensure `censorFn` copes with null `regexpList` (#17754)
This fixes the test suite failures introduced by 862007fb18
This commit is contained in:
parent
d3e8442937
commit
4bf9b73296
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue