ZF-5050: "Call to a member function close() on a non-object" when using Zend_Db_Adapter_Mysqli::closeConnection()

Description

Some small bug I found in the closeConnection() method:

public function closeConnection()
{
    $this->_connection->close();
    $this->_connection = null;
}

you should do something like that:

public function closeConnection()
{
    if (is_null($this->_connection))
        return;

    $this->_connection->close();
    $this->_connection = null;
}

Otherwise the following error is occured if you do not do anything with the object, e.g.:

1.) $mysql = new Zend_Db_Adapter_Mysqli($config); 2.) $mysql->closeConnection();

Fatal error: Call to a member function close() on a non-object in ???\Zend\Db\Adapter\Mysqli.php on line 326

Comments

Resolved with SVN12978

Merged to 1.7-branch