Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.585
diff -u -p -r1.585 comment.module
--- modules/comment/comment.module      28 Sep 2007 17:15:04 -0000      1.585
+++ modules/comment/comment.module      29 Sep 2007 09:27:07 -0000
@@ -661,13 +661,18 @@ function comment_edit($cid) {
   global $user;
 
   $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d', $cid));
-  $comment = drupal_unpack($comment);
-  $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
-  if (comment_access('edit', $comment)) {
-    return comment_form_box((array)$comment);
+  if ($comment) {
+    $comment = drupal_unpack($comment);
+    $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
+    if (comment_access('edit', $comment)) {
+      return comment_form_box((array)$comment);
+    }
+    else {
+      drupal_access_denied();
+    }
   }
   else {
-    drupal_access_denied();
+    drupal_not_found();
   }
 }
