Index: modules/comment/comment.module
===================================================================
--- modules/comment/comment.module	(revision 59)
+++ modules/comment/comment.module	(working copy)
@@ -613,9 +613,16 @@
 
     case 'update index':
       $text = '';
-      $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
-      while ($comment = db_fetch_object($comments)) {
-        $text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
+      $permitted_comment_statuses = array(COMMENT_NODE_READ_ONLY, COMMENT_NODE_READ_WRITE);
+      $result = db_result(db_query("SELECT comment FROM {node} WHERE nid = %d", $node->nid));
+
+      // Only grab the comments if the comments are enabled, and commenting on
+      // the node is in read only, or read/write status (not disabled).
+      if (in_array($result, $permitted_comment_statuses)) {
+        $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = %d', $node->nid, COMMENT_PUBLISHED);
+        while ($comment = db_fetch_object($comments)) {
+          $text .= '<h2>'. check_plain($comment->subject) .'</h2>'. check_markup($comment->comment, $comment->format, FALSE);
+        }
       }
       return $text;
 
