This is an automated email from the ASF dual-hosted git repository.

likyh pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit cb92da02cc7d85f6475db879a70ef2c307b1f343
Author: linyh <[email protected]>
AuthorDate: Wed Oct 19 19:41:41 2022 +0800

    fix: fix bug for github_graphql when language is empty
---
 plugins/github_graphql/tasks/repo_collector.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plugins/github_graphql/tasks/repo_collector.go 
b/plugins/github_graphql/tasks/repo_collector.go
index 516dad2c..e96ad410 100644
--- a/plugins/github_graphql/tasks/repo_collector.go
+++ b/plugins/github_graphql/tasks/repo_collector.go
@@ -96,6 +96,10 @@ func CollectRepo(taskCtx core.SubTaskContext) errors.Error {
                        query := iQuery.(*GraphqlQueryRepo)
                        repository := query.Repository
                        results := make([]interface{}, 0, 1)
+                       language := ``
+                       if len(repository.Languages.Nodes) > 0 {
+                               language = repository.Languages.Nodes[0].Name
+                       }
                        githubRepository := &models.GithubRepo{
                                ConnectionId: data.Options.ConnectionId,
                                GithubId:     repository.GithubId,
@@ -104,7 +108,7 @@ func CollectRepo(taskCtx core.SubTaskContext) errors.Error {
                                Description:  repository.Description,
                                OwnerId:      repository.Owner.Id,
                                OwnerLogin:   repository.Owner.Login,
-                               Language:     
repository.Languages.Nodes[0].Name,
+                               Language:     language,
                                CreatedDate:  repository.CreatedDate,
                                UpdatedDate:  repository.UpdatedDate,
                        }

Reply via email to