diff --git a/src/Connection/Nsqd.php b/src/Connection/Nsqd.php index 4149d00..d13a8fe 100644 --- a/src/Connection/Nsqd.php +++ b/src/Connection/Nsqd.php @@ -128,7 +128,10 @@ public function setLifecycle($seconds) */ public function setProducer() { - $this->connTCP->setRecycling($this->lifecycle); + if ($this->connTCP) + { + $this->connTCP->setRecycling($this->lifecycle); + } return $this; }