From dc501d6984b139346151c91fe69544aa884e282d Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sun, 19 Nov 2017 19:25:14 +0100 Subject: [PATCH] fix: don't delete if we don't have any IDs #313 --- GameEngine/Automation.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index c624dedc..a3f711f6 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3795,8 +3795,10 @@ class Automation { } } - $q = "DELETE FROM ".TB_PREFIX."research where id IN(".implode(', ', $deleteIDs).")"; - $database->query($q); + if (count($deleteIDs)) { + $q = "DELETE FROM " . TB_PREFIX . "research where id IN(" . implode( ', ', $deleteIDs ) . ")"; + $database->query( $q ); + } if(file_exists("GameEngine/Prevention/research.txt")) { unlink("GameEngine/Prevention/research.txt");