Skip to content

Commit

Permalink
Merge pull request doctrine#864 from randomonkey/master
Browse files Browse the repository at this point in the history
Fix undefined notices within MasterSlaveConnection
  • Loading branch information
guilhermeblanco committed May 22, 2015
2 parents 9e79546 + cfddafc commit a0a43c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function connect($connectionName = null)
// If we have a connection open, and this is not an explicit connection
// change request, then abort right here, because we are already done.
// This prevents writes to the slave in case of "keepSlave" option enabled.
if ($this->_conn && !$requestedConnectionChange) {
if (isset($this->_conn) && $this->_conn && !$requestedConnectionChange) {
return false;
}

Expand All @@ -162,7 +162,7 @@ public function connect($connectionName = null)
$forceMasterAsSlave = true;
}

if ($this->connections[$connectionName]) {
if (isset($this->connections[$connectionName]) && $this->connections[$connectionName]) {
$this->_conn = $this->connections[$connectionName];

if ($forceMasterAsSlave && ! $this->keepSlave) {
Expand Down

0 comments on commit a0a43c0

Please sign in to comment.