Skip to content

Commit 122dc02

Browse files
authored
handle unexpected nil items (#11)
1 parent c64de7d commit 122dc02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

githubpagination/searchresult/gh_merger.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ func (g *Merger) Digest(reader io.Reader) (slice json.RawMessage, err error) {
2828
g.totalCount += result.TotalCount
2929
g.incompleteResults = g.incompleteResults || result.IncompleteResults
3030

31+
if result.Items == nil {
32+
return nil, nil
33+
}
34+
3135
return *result.Items, nil
3236
}
3337

0 commit comments

Comments
 (0)