diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-20 11:12:33 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-20 11:12:33 +0000 |
| commit | e47192e40dee5544cec3de588cb340a16cae25b1 (patch) | |
| tree | 69c9c8a8bf014d0355c642d4d69605a12eb22def /roundcubemail/program | |
| parent | 12b8376314c4535b4205b7e816847ebcdf336293 (diff) | |
- handle errors in insert_id()
git-svn-id: https://svn.roundcube.net/trunk@2772 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_mdb2.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_mdb2.php b/roundcubemail/program/include/rcube_mdb2.php index a83b463b4..86d798a79 100644 --- a/roundcubemail/program/include/rcube_mdb2.php +++ b/roundcubemail/program/include/rcube_mdb2.php @@ -330,7 +330,9 @@ class rcube_mdb2 if (!$this->db_handle || $this->db_mode=='r') return FALSE; - return $this->db_handle->lastInsertID($sequence); + $id = $this->db_handle->lastInsertID($sequence); + + return $this->db_handle->isError($id) ? null : $id; } |
