From 0d79219e46f0fb6d6261f37764efc1196b45213b Mon Sep 17 00:00:00 2001 From: Haiyan Meng Date: Wed, 11 Dec 2019 13:54:01 -0800 Subject: [PATCH] Avoid processing the nil pointer returned by kustomizationResultAdapter Currently, the crawler job panics whenever a nil pointer is returned by kustomizationResultAdapter. --- api/internal/crawl/crawler/github/crawler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/internal/crawl/crawler/github/crawler.go b/api/internal/crawl/crawler/github/crawler.go index 1184171de..a42c33074 100644 --- a/api/internal/crawl/crawler/github/crawler.go +++ b/api/internal/crawl/crawler/github/crawler.go @@ -193,7 +193,9 @@ func processQuery(ctx context.Context, gcl GhClient, query string, errs = append(errs, err) errorCnt++ } - output <- k + if k != nil { + output <- k + } totalCnt++ }