* fix a bug.

This commit is contained in:
wangyidong
2014-08-21 01:54:42 +00:00
parent 60595ffa00
commit 5d2a658222
4 changed files with 26 additions and 24 deletions
+8 -8
View File
@@ -220,20 +220,20 @@ class bug extends control
$response['message'] = '';
$bugResult = $this->bug->create();
$bugID = $bugResult['id'];
if($bugResult['status'] == 'existed')
{
$response['locate'] = $this->createLink('bug', 'view', "bugID=$bugID");
$this->send($response);
}
if(dao::isError())
if(!$bugResult or dao::isError())
{
$response['result'] = 'fail';
$response['message'] = dao::getError();
$this->send($response);
}
$bugID = $bugResult['id'];
if($bugResult['status'] == 'existed')
{
$response['locate'] = $this->createLink('bug', 'view', "bugID=$bugID");
$this->send($response);
}
$actionID = $this->action->create('bug', $bugID, 'Opened');
$this->sendmail($bugID, $actionID);