Fix warning if no indices exist in object.
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 18 Sep 2010 06:26:11 +0000 (00:26 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 20 Sep 2010 05:24:46 +0000 (23:24 -0600)
imp/lib/Indices.php

index 208af08..b70edaf 100644 (file)
@@ -203,8 +203,9 @@ class IMP_Indices implements Countable, Iterator
 
     public function rewind()
     {
-        reset($this->_indices);
-        reset(current($this->_indices));
+        if (reset($this->_indices)) {
+            reset(current($this->_indices));
+        }
     }
 
     public function valid()