Fix panic when when nuclei server is shutdown
@@ -37,7 +37,7 @@ const (
// HTTPErrorRetryPolicy is to retry for HTTPCodes >= 500.
func HTTPErrorRetryPolicy() func(ctx context.Context, resp *http.Response, err error) (bool, error) {
return func(ctx context.Context, resp *http.Response, err error) (bool, error) {
- if resp.StatusCode >= http.StatusInternalServerError {
+ if resp != nil && resp.StatusCode >= http.StatusInternalServerError {
return true, errors.New(resp.Status)
}
return retryablehttp.CheckRecoverableErrors(ctx, resp, err)
