diff --git a/module/ci/control.php b/module/ci/control.php index 80a1c3fb4b..f10bdd27cd 100644 --- a/module/ci/control.php +++ b/module/ci/control.php @@ -158,8 +158,9 @@ class ci extends control */ public function exeJob($id) { - $this->ci->exeJob($id); + $result = $this->ci->exeJob($id); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(!$result) $this->send(array('result' => 'fail', 'message' => 'not found')); $this->send(array('result' => 'success')); } diff --git a/module/ci/model.php b/module/ci/model.php index f255e483d3..69a9c70b7d 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -184,6 +184,10 @@ class ciModel extends model ->where('job.id')->eq($jobID) ->fetch(); + if (!$po) { + return false; + } + $jenkinsServer = $po->serviceUrl; $jenkinsUser = $po->account; $jenkinsTokenOrPassword = $po->token ? $po->token : base64_decode($po->password);