Эх сурвалжийг харах

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.
Daniele Alessandri 12 жил өмнө
parent
commit
de4bae3f9b

+ 1 - 1
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();
         }
     }