From aeae405f64a67bd66fb303145ca750953c04f154 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Sat, 2 Dec 2017 18:55:30 +0100 Subject: [PATCH] make del trigger a bit more idiotensicher --- src/trigger/del.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trigger/del.js b/src/trigger/del.js index 8161a94..e467d8b 100644 --- a/src/trigger/del.js +++ b/src/trigger/del.js @@ -10,7 +10,7 @@ module.exports = (lib) => { var ids = e.message.split(' '); ids.shift(); ids.forEach(id => { - if(Number.isInteger(parseInt(id))) { + if(Number.isInteger(parseInt(id)) && parseInt(id) > 0) { lib.sql.query("select `dest` from `f0ck`.`items` where `id` = ? limit 1", id, (err, rows) => { if(rows[0]) { lib.sql.query("delete from `f0ck`.`items` where `id` = ? limit 1", id, err => { @@ -29,4 +29,4 @@ module.exports = (lib) => { }, desc: 'delete f0ck' }); -}; \ No newline at end of file +};