--- apachesolr_mlt.module	2009-02-04 09:43:43.000000000 -0500
+++ apachesolr_mlt.module.new	2009-02-04 09:43:32.000000000 -0500
@@ -98,17 +98,10 @@ function apachesolr_mlt_suggestions($blo
     $suggestions = array();
     if ($response->response) {
       $r = (array) end($response->response);
-      $links = array();
 
-      if (is_array($r)) {
-        foreach ($r as $result) {
-          $links[] = l($result->title, $result->url);
-        }
-      }
-
-      if (count($links) > 0) {
+      if (is_array($r) && count($r) > 0) {
         $suggestions['subject'] = $block['name'];
-        $suggestions['content'] = theme('apachesolr_mlt_recommendation_block', $links);
+        $suggestions['content'] = theme('apachesolr_mlt_recommendation_block', $r);
       }
     }
     return $suggestions;
@@ -125,7 +118,11 @@ function apachesolr_mlt_theme($existing,
   );
 }
 
-function theme_apachesolr_mlt_recommendation_block($links) {
+function theme_apachesolr_mlt_recommendation_block($docs) {
+  $links = array();
+  foreach ($docs as $doc) {
+    $links[] = l($doc->title, $doc->url);
+  }
   return theme('item_list', $links);
 }
 
