From 1d8d3738e169c64162b017f2e4722f4f9f5d0ad3 Mon Sep 17 00:00:00 2001 From: Gal Ofri Date: Wed, 12 Mar 2025 16:09:09 +0700 Subject: [PATCH] handle unexpected nil items --- githubpagination/searchresult/gh_merger.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/githubpagination/searchresult/gh_merger.go b/githubpagination/searchresult/gh_merger.go index 0b8383c..aa258a2 100644 --- a/githubpagination/searchresult/gh_merger.go +++ b/githubpagination/searchresult/gh_merger.go @@ -28,6 +28,10 @@ func (g *Merger) Digest(reader io.Reader) (slice json.RawMessage, err error) { g.totalCount += result.TotalCount g.incompleteResults = g.incompleteResults || result.IncompleteResults + if result.Items == nil { + return nil, nil + } + return *result.Items, nil }