Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.577
diff -u -p -r1.577 taxonomy.module
--- modules/taxonomy/taxonomy.module	11 Feb 2010 17:44:47 -0000	1.577
+++ modules/taxonomy/taxonomy.module	23 Feb 2010 15:29:38 -0000
@@ -1264,8 +1264,10 @@ function taxonomy_field_formatter_prepar
   // Collect every possible term attached to any of the fieldable entities.
   foreach ($entities as $id => $entity) {
     foreach ($items[$id] as $delta => $item) {
-      // Force the array key to prevent duplicates.
-      $tids[$item['tid']] = $item['tid'];
+      if (!empty($item['tid']) {
+        // Force the array key to prevent duplicates.
+        $tids[$item['tid']] = $item['tid'];
+      }
     }
   }
   if ($tids) {
