From bfbb80b17a687ba7df01ddfeb20f0ead9a3e4288 Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Thu, 31 Jan 2013 16:35:02 +0100 Subject: [PATCH] Fixed problems when no current result exists. --- NEWS | 3 +++ ykval-db-pdo.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8faca29..b8fc69d 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ * Version 2.21 unreleased + * Fixed a problem that caused ykval-queue to terminate if the database + was not available initially. + * Version 2.20 released 2013-01-31 * Add ChangeLog generation using git2cl. diff --git a/ykval-db-pdo.php b/ykval-db-pdo.php index 3032490..15d300a 100644 --- a/ykval-db-pdo.php +++ b/ykval-db-pdo.php @@ -28,6 +28,7 @@ class DbImpl extends Db $this->db_username=$db_username; $this->db_password=$db_password; $this->db_options=$db_options; + $this->result = null; $this->myLog=new Log($name); } @@ -96,7 +97,7 @@ class DbImpl extends Db */ public function closeCursor($result=null){ if(!$result) $result = $this->result; - $result->closeCursor(); + if($result) $result->closeCursor(); } public function truncateTable($name)