From 396dd62d3b3f7acc890116205b58b55d77b41e0e Mon Sep 17 00:00:00 2001 From: ratkosrb Date: Wed, 15 May 2024 14:16:32 +0300 Subject: [PATCH] Fix crash if warden scans table is empty. --- src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp b/src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp index a6f0fb32b80..c897fe382f3 100644 --- a/src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp +++ b/src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp @@ -81,6 +81,12 @@ void WardenScanMgr::LoadFromDB() // 0 1 2 3 4 5 6 7 8 9 10 11 std::unique_ptr result(WorldDatabase.Query("SELECT `id`, `type`, `str`, `data`, `address`, `length`, `result`, `flags`, `penalty`, `build_min`, `build_max`, `comment` FROM `warden_scans`")); + if (!result) + { + sLog.Out(LOG_ANTICHEAT, LOG_LVL_ERROR, "Table `warden_scans` is empty!"); + return; + } + // copy any non-database scans into a placeholder std::vector > new_scans; new_scans.reserve(m_scans.size());