Skip to content

Commit dfea153

Browse files
committed
fix(certificate): Handle lookup that returns a list of 0 certs.
1 parent c8285b1 commit dfea153

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

v2/api/certificate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ func (c *Client) GetCertificateContext(gca *GetCertificateContextArgs) (*GetCert
499499
}
500500
}
501501
return &newestCert, nil
502+
} else if len(lCerts) == 0 {
503+
return nil, fmt.Errorf("no certificate found")
502504
}
503505
return &lCerts[0], nil // Return first cert in list
504506
}

0 commit comments

Comments
 (0)