Index: feedapi_mapper.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi_mapper/feedapi_mapper.module,v
retrieving revision 1.1.2.7.2.19
diff -u -p -r1.1.2.7.2.19 feedapi_mapper.module
--- feedapi_mapper.module	10 Mar 2009 19:57:20 -0000	1.1.2.7.2.19
+++ feedapi_mapper.module	17 Mar 2009 15:28:41 -0000
@@ -427,7 +427,10 @@ function _feedapi_mapper_get_feed_elemen
   $elements = array();
   while (count($merged_item)) {
     $path = array();
-    $path = _feedapi_mapper_next_element_path($merged_item, $path);
+    $path = _feedapi_mapper_next_element_path($merged_item, $path, TRUE);
+    if ($path == FALSE) {
+      break;
+    }
     $elements[implode('->', $path)] = serialize($path);
   }
   return $elements;
@@ -440,13 +443,16 @@ function _feedapi_mapper_get_feed_elemen
  * A path to a leaf element in the format
  * array(path, to, leaf, element);
  */
-function _feedapi_mapper_next_element_path(&$items, &$path) {
+function _feedapi_mapper_next_element_path(&$items, &$path, $reset_count = FALSE) {
   // This recursion is a bit shaky. Put on breaks.
-  static $i;
+  static $i = 0;
   $i++;
+  if ($reset_count) {
+    $i = 0;
+  }
   if ($i > 200) {
     drupal_set_message(t('Error in recursion _feedapi_mapper_next_element_path()'), 'error');
-    return array();
+    return FALSE;
   }
   foreach ($items as $key => $value) {
     $path[] = $key;

