? modules/comment/.comment.module.swp
? sites/default/files
? sites/default/settings.php
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.891
diff -u -p -r1.891 comment.module
--- modules/comment/comment.module	22 Aug 2010 10:01:06 -0000	1.891
+++ modules/comment/comment.module	22 Aug 2010 13:37:42 -0000
@@ -602,6 +602,7 @@ function theme_comment_block() {
  * Implements hook_node_view().
  */
 function comment_node_view($node, $view_mode) {
+  $node_type_exists = array_key_exists($node->type, node_type_get_names());
   $links = array();
 
   if ($node->comment) {
@@ -642,7 +643,7 @@ function comment_node_view($node, $view_
         }
         else {
           if ($node->comment == COMMENT_NODE_OPEN) {
-            if (user_access('post comments')) {
+            if (user_access('post comments') && $node_type_exists) {
               $links['comment-add'] = array(
                 'title' => t('Add new comment'),
                 'href' => "comment/reply/$node->nid",
@@ -663,7 +664,7 @@ function comment_node_view($node, $view_
       // allowed to post comments and if this node is allowing new comments.
       // But we don't want this link if we're building the node for search
       // indexing.
-      if ($node->comment == COMMENT_NODE_OPEN) {
+      if ($node->comment == COMMENT_NODE_OPEN && $node_type_exists) {
         if (user_access('post comments')) {
           $links['comment-add'] = array(
             'title' => t('Add new comment'),
@@ -699,7 +700,10 @@ function comment_node_view($node, $view_
     // appended to other nodes shown on the page, for example a node_reference
     // displayed in 'full' view mode within another node.
     if ($node->comment && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview) && user_access('access comments')) {
-      $node->content['comments'] = comment_node_page_additions($node);
+      // Do not show comments form if the node type has been deleted.
+      if (array_key_exists($node->type, node_type_get_names())) {
+        $node->content['comments'] = comment_node_page_additions($node);
+      }
     }
   }
 }
