Solr Indexing Error showing "EntityMalformedException: Missing bundle property on entity of type taxonomy_term" In Drupal 7.14, when i Index my Whole Site, Solr is showing following error:

AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. 
Path: /batch?id=1938&amp;op=do StatusText: Service unavailable (with message)
ResponseText: EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7539 of /project/path/includes/common.inc).


So when i look into the lines in /includes/common.inc (around lines: 7537):

// Explicitly fail for malformed entities missing the bundle property.
if (!isset($entity-&gt;{$info['entity keys']['bundle']}) || $entity-&gt;{$info['entity keys']['bundle']} === '') {
  throw new EntityMalformedException(t('Missing bundle property on entity of type @entity_type.', array('@entity_type' =&gt; $entity_type)));
}



What is that chunk of code (in common.inc) is doing actually please?
How can i overcome that error?
Drupal tries to index an invalid item and throws this error. 
To find out what document is causing the error, you can implement the hook_apachesolr_index_document_build hook with a watchdog statement inside.

This is from apachesolr.api.php


/**
 * Build the documents before sending them to Solr.
 * The function is the follow-up for apachesolr_update_index
 *
 * @param integer $document_id
 * @param array $entity
 * @param string $entity_type
 */
function hook_apachesolr_index_document_build(ApacheSolrDocument $document, $entity, $entity_type, $env_id) {

}


My guess is that the last item in your dblog will be the offending item.