diff --git a/module/my/control.php b/module/my/control.php index 96593fcdb5..ec90460d6b 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1021,6 +1021,10 @@ EOF; return $this->send($response); } $listID = $this->user->createContactList($data->newList, $data->users); + if(dao::isError()) + { + return $this->send(array('result' => 'fail', 'message' => dao::getError())); + } $this->user->setGlobalContacts($listID, isset($data->share)); if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.parent.ajaxGetContacts('#mailto')")); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('manageContacts', "listID=$listID"))); diff --git a/module/user/model.php b/module/user/model.php index 3b9565fa1b..ddca3fbfd3 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1486,7 +1486,7 @@ class userModel extends model $this->dao->insert(TABLE_USERCONTACT)->data($data) ->autoCheck() ->exec(); - if(dao::isError()) return print(js::error(dao::getError())); + if(dao::isError()) return false; return $this->dao->lastInsertID(); }