Exit early if no results
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 11 May 2010 16:25:05 +0000 (12:25 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 11 May 2010 16:25:05 +0000 (12:25 -0400)
framework/ActiveSync/lib/Horde/ActiveSync/Driver/Horde.php

index 1772c67..f58c4ea 100644 (file)
@@ -596,9 +596,11 @@ class Horde_ActiveSync_Driver_Horde extends Horde_ActiveSync_Driver_Base
             return $return;
         }
 
-        /* Honor range */
+        /* Honor range, and don't bother if no results */
         $count = count($results);
-
+        if (!$count) {
+            return $return;
+        }
         $this->_logger->info('Horde::getSearchResults found ' . $count . ' matches.');
 
         preg_match('/(.*)\-(.*)/', $range, $matches);