Sfoglia il codice sorgente

Check for null values when setting a protocol processor instance for a connection.

Daniele Alessandri 14 anni fa
parent
commit
784b33358d
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      lib/Predis.php

+ 3 - 0
lib/Predis.php

@@ -1278,6 +1278,9 @@ abstract class ConnectionBase implements IConnectionSingle {
     }
     }
 
 
     public function setProtocol(IRedisProtocol $protocol) {
     public function setProtocol(IRedisProtocol $protocol) {
+        if ($protocol === null) {
+            throw new \InvalidArgumentException("The protocol instance cannot be a null value");
+        }
         $this->_protocol = $protocol;
         $this->_protocol = $protocol;
     }
     }