From de4bae3f9ba5631ac040fd8f71a7f31444bdbb8e Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sun, 17 Feb 2013 14:15:43 +0100 Subject: [PATCH] Prevent E_NOTICE messages on __destruct() if $parameters is not set. This can only happen when throwing on invalid connection parameters, this is a quick fix that will do for now. --- lib/Predis/Connection/StreamConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Predis/Connection/StreamConnection.php b/lib/Predis/Connection/StreamConnection.php index f3024642..8a8858aa 100644 --- a/lib/Predis/Connection/StreamConnection.php +++ b/lib/Predis/Connection/StreamConnection.php @@ -54,7 +54,7 @@ class StreamConnection extends AbstractConnection */ public function __destruct() { - if (!$this->parameters->persistent) { + if (isset($this->parameters) && !$this->parameters->persistent) { $this->disconnect(); } }