From 82dcc713c43ee7bef5fc3641675f888ad3c13b6a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 12 Aug 2014 01:18:06 +0000 Subject: [PATCH] * fix a bug. --- module/testtask/control.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index f207e6cf60..4ae736c513 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -182,13 +182,18 @@ class testtask extends control $productID = $task->product; $buildID = $task->build; - $build = $this->loadModel('build')->getByID($buildID); + $build = $this->loadModel('build')->getByID($buildID); + $stories = array(); + $bugs = array(); - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchAll(); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); + if($build) + { + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchAll(); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); - $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); + } $this->testtask->setMenu($this->products, $productID);