Explorar o código

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

Daniele Alessandri %!s(int64=14) %!d(string=hai) anos
pai
achega
784b33358d
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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) {
+        if ($protocol === null) {
+            throw new \InvalidArgumentException("The protocol instance cannot be a null value");
+        }
         $this->_protocol = $protocol;
     }