소스 검색

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

Daniele Alessandri 15 년 전
부모
커밋
784b33358d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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;
     }