ソースを参照

refactor: small change to fix some Redis errors

Kristian Vos 5 年 前
コミット
4489b88d2d
1 ファイル変更1 行追加1 行削除
  1. 1 1
      backend/logic/cache/index.js

+ 1 - 1
backend/logic/cache/index.js

@@ -138,7 +138,7 @@ module.exports = class extends coreClass {
 	async hdel(table, key, cb) {
 		try { await this._validateHook(); } catch { return; }
 
-		if (!key || !table) return cb(null, null);
+		if (!key || !table || typeof key !== "string") return cb(null, null);
 		if (mongoose.Types.ObjectId.isValid(key)) key = key.toString();
 
 		this.client.hdel(table, key, (err) => {