diff --git a/src/Connection/Aggregate/MasterSlaveReplication.php b/src/Connection/Aggregate/MasterSlaveReplication.php index ea5dc775..de7494df 100644 --- a/src/Connection/Aggregate/MasterSlaveReplication.php +++ b/src/Connection/Aggregate/MasterSlaveReplication.php @@ -207,7 +207,9 @@ class MasterSlaveReplication implements ReplicationInterface */ protected function pickSlave() { - return $this->slaves[array_rand($this->slaves)]; + if ($this->slaves) { + return $this->slaves[array_rand($this->slaves)]; + } } /**