From 012207b927db49e6d1f8fe65fa2bf943bede200a Mon Sep 17 00:00:00 2001 From: Fernando Takagi Date: Mon, 29 May 2023 19:06:55 -0300 Subject: [PATCH] Add search step safeguard. --- server/matchmaker_process.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/matchmaker_process.go b/server/matchmaker_process.go index bf9d2472b..c04e9e77e 100644 --- a/server/matchmaker_process.go +++ b/server/matchmaker_process.go @@ -471,8 +471,8 @@ func (m *LocalMatchmaker) processCustom() [][]*MatchmakerEntry { continue } - // Reset if last step. - if searchStep > maxSearchSteps { + // Reset if last step or no more results. + if searchStep > maxSearchSteps || len(blugeMatches.Hits) == 0 { searchStartIndex = 0 searchStep = 1 } else if len(blugeMatches.Hits) > 0 { -- GitLab