Skip to content

Commit c985ba3

Browse files
authored
fix: guard against a nil resp (#267)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 3d5e8fb commit c985ba3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

input/chainsync/chainsync.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ func getKupoClient(c *ChainSync) (*kugo.Client, error) {
450450
if err != nil {
451451
return nil, fmt.Errorf("failed to perform health check: %w", err)
452452
}
453+
if resp == nil {
454+
return nil, fmt.Errorf("health check response empty, aborting")
455+
}
453456
defer resp.Body.Close()
454457

455458
if resp.StatusCode != http.StatusOK {

0 commit comments

Comments
 (0)