diff --git a/apachesolr.module b/apachesolr.module
index df8714a..d1fc018 100644
--- a/apachesolr.module
+++ b/apachesolr.module
@@ -2029,19 +2029,23 @@ function apachesolr_entity_fields($entity_type = 'node') {
 function content_apachesolr_index_document_build(ApacheSolrDocument $document, $entity, $entity_type) {
   $indexed_fields = apachesolr_entity_fields($entity_type);
   foreach ($indexed_fields as $index_key => $nodefields) {
-    foreach ($nodefields as $field_info) {
-      $field_name = $field_info['field']['field_name'];
-      // See if the node has fields that can be indexed
-      if (isset($entity->{$field_name})) {
-        // Got a field.
-        $function = $field_info['indexing_callback'];
-        if ($function && function_exists($function)) {
-          // NOTE: This function should always return an array.  One
-          // entity field may be indexed to multiple Solr fields.
-          $fields = $function($entity, $field_name, $index_key, $field_info);
-          foreach ($fields as $field) {
-            // It's fine to use this method also for single value fields.
-            $document->setMultiValue($field['key'], $field['value']);
+    if (!empty($nodefields)) {
+      foreach ($nodefields as $field_info) {
+        if (is_array($field_info['field'])) {
+          $field_name = $field_info['field']['field_name'];
+        }
+        // See if the node has fields that can be indexed
+        if (isset($entity->{$field_name})) {
+          // Got a field.
+          $function = $field_info['indexing_callback'];
+          if ($function && function_exists($function)) {
+            // NOTE: This function should always return an array.  One
+            // entity field may be indexed to multiple Solr fields.
+            $fields = $function($entity, $field_name, $index_key, $field_info);
+            foreach ($fields as $field) {
+              // It's fine to use this method also for single value fields.
+              $document->setMultiValue($field['key'], $field['value']);
+            }
           }
         }
       }
