Bläddra i källkod

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

Daniele Alessandri 14 år sedan
förälder
incheckning
784b33358d
1 ändrade filer med 3 tillägg och 0 borttagningar
  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;
     }