From 6955c70f286dee3d003736c911ad9d3203b0be6c Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 20 Jul 2009 11:12:33 +0000 Subject: - handle errors in insert_id() --- program/include/rcube_mdb2.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'program/include') diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index a83b463b4..86d798a79 100644 --- a/program/include/rcube_mdb2.php +++ b/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; } -- cgit v1.2.3