From cfd5455a58eea2abefb8d9a0c39c6598c20abccb Mon Sep 17 00:00:00 2001 From: liyuchun Date: Wed, 1 Dec 2021 15:03:28 +0800 Subject: [PATCH] * Fix error when has no gitlab. --- module/job/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/job/control.php b/module/job/control.php index 35d2bc28a0..961f71c525 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -105,7 +105,7 @@ class job extends control $repoTypes[$repo->id] = $repo->SCM; if(strtolower($repo->SCM) == 'gitlab') { - $gitlab = $this->loadModel('gitlab')->getByID($repo->gitlab); + if(isset($repo->gitlab)) $gitlab = $this->loadModel('gitlab')->getByID($repo->gitlab); if(!empty($gitlab)) $tokenUser = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token); if(!isset($tokenUser->is_admin) or !$tokenUser->is_admin) continue; $gitlabRepos[$repo->id] = $repo->name;