fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-09-07 10:59 am

[dw-free] clean up error logs

[commit: http://hg.dwscoalition.org/dw-free/rev/edd7b53e1911]

http://bugs.dwscoalition.org/show_bug.cgi?id=2812

Don't try to get a comment count for deleted entries.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Controller/CommentCount.pm
--------------------------------------------------------------------------------
diff -r bd937c21f12f -r edd7b53e1911 cgi-bin/DW/Controller/CommentCount.pm
--- a/cgi-bin/DW/Controller/CommentCount.pm	Tue Sep 07 18:48:51 2010 +0800
+++ b/cgi-bin/DW/Controller/CommentCount.pm	Tue Sep 07 18:59:06 2010 +0800
@@ -37,6 +37,7 @@ sub commentcount_handler {
         my $ditemid = $args->{ditemid};
         my $uid = LJ::get_userid( $args->{user} );
         $entry = LJ::Entry->new( $uid, ditemid => $ditemid ) if $uid;
+        $entry = undef unless $entry && $entry->valid;
     }
 
     $count = $entry->reply_count if $entry;
--------------------------------------------------------------------------------