Преглед изворни кода

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 година
родитељ
комит
de4bae3f9b
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/Predis/Connection/StreamConnection.php

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