From 5396d4a0de62da3607f22b5635689fdfe9c0449b Mon Sep 17 00:00:00 2001 From: William Harrison Date: Sat, 1 Jul 2023 09:38:08 +0800 Subject: [PATCH] fix: `words` is undefined when filter empty --- src/util/database/cleanFilter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/database/cleanFilter.js b/src/util/database/cleanFilter.js index c84f862..503ac71 100644 --- a/src/util/database/cleanFilter.js +++ b/src/util/database/cleanFilter.js @@ -1,8 +1,8 @@ module.exports = async function cleanChannels() { const schema = require("../../models/filterSchema"); - let autobanData = await schema.findOne({ _id: "autoban" }); - let blockData = await schema.findOne({ _id: "block" }); + let autobanData = await schema.findOne({ _id: "autoban" }) || { words: [] }; + let blockData = await schema.findOne({ _id: "block" }) || { words: [] }; const promises = [];