fix: nil panics rendering last page of search results
Alan Pearce alan@alanpearce.eu
Sat, 13 Jul 2024 17:03:08 +0200
1 files changed, 1 insertions(+), 1 deletions(-)
jump to
M internal/index/search.go → internal/index/search.go
@@ -109,7 +109,7 @@ if err != nil { return nil, errors.WithMessage(err, "failed to execute search query") } - results := make([]DocumentMatch, min(ResultsPerPage, bleveResult.Total)) + results := make([]DocumentMatch, bleveResult.Hits.Len()) var buf bytes.Buffer for i, result := range bleveResult.Hits { results[i].DocumentMatch = bleveResult.Hits[i]