Browse Source

Invoke preprocessors after checking if a command is defined by the current profile.

Daniele Alessandri 14 years ago
parent
commit
33f6419700
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/Predis/Profiles/ServerProfile.php

+ 3 - 3
lib/Predis/Profiles/ServerProfile.php

@@ -73,12 +73,12 @@ abstract class ServerProfile implements IServerProfile, IPreprocessingSupport {
     }
 
     public function createCommand($method, $arguments = array()) {
-        if (isset($this->_preprocessor)) {
-            $this->_preprocessor->process($method, $arguments);
-        }
         if (!isset($this->_registeredCommands[$method])) {
             throw new ClientException("'$method' is not a registered Redis command");
         }
+        if (isset($this->_preprocessor)) {
+            $this->_preprocessor->process($method, $arguments);
+        }
         $commandClass = $this->_registeredCommands[$method];
         $command = new $commandClass();
         $command->setArgumentsArray($arguments);