Skip to content

Commit

Permalink
Fix crash if warden scans table is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed May 15, 2024
1 parent 926daf4 commit 396dd62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/game/Anticheat/WardenAnticheat/WardenScanMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ void WardenScanMgr::LoadFromDB()
// 0 1 2 3 4 5 6 7 8 9 10 11
std::unique_ptr<QueryResult> 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<std::shared_ptr<Scan const> > new_scans;
new_scans.reserve(m_scans.size());
Expand Down

0 comments on commit 396dd62

Please sign in to comment.