1. Michael Gatto
  2. VersionControl_Hg

Commits

Michael Gatto  committed 9bea850

* Fixed bug where empty cat() raised an exception from a non-existent offset of [0].

  • Participants
  • Parent commits 82bdd9b
  • Branches default

Comments (0)

Files changed (1)

File Trunk/VersionControl/Hg/Command/Cat.php

View file
         $this->setOptions(array());
 
         /* $params is always an array with key [0] since we use
-         * call_user_func_array() */
-        if ( is_scalar($params[0]) ) {
+         * call_user_func_array(). However, if cat() has no arguments,
+         * it is an empty array. */
+        if ( (! empty($params)) && (isset($params[0])) ) {
             $this->addOption('files', $params[0]);
-        } elseif ( is_null($params[0]) ) {
-            //throw an exception (?)
         }
     }