When bannedWords table is empty or not set, the function will throw an error because we were not checking for null. I've added a null-check which displays the problem in the console and immediately returns from the function.
Tested locally and it works as expected. The error doesn't appear and we get the "No banned words found in database" message instead.
When
bannedWords
table is empty or not set, the function will throw an error because we were not checking for null. I've added a null-check which displays the problem in the console and immediately returns from the function.Tested locally and it works as expected. The error doesn't appear and we get the "No banned words found in database" message instead.