diff --git a/src/Broker.php b/src/Broker.php index d3ddc7aa..1a7c7cdc 100644 --- a/src/Broker.php +++ b/src/Broker.php @@ -111,13 +111,13 @@ public function getDataConnect($key, $modeSync = false) public function getConnect($key, $type, $modeSync = false) { - if (isset($this->{$type}[$key])) { + if (isset($this->{$type}[$key]) && $this->{$type}[$key]->isResource()) { return $this->{$type}[$key]; } if (isset($this->brokers[$key])) { $hostname = $this->brokers[$key]; - if (isset($this->{$type}[$hostname])) { + if (isset($this->{$type}[$hostname]) && $this->{$type}[$hostname]->isResource()) { return $this->{$type}[$hostname]; } }