fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-05-17 05:35 am

[dw-free] Ugly error when trying to view the threadroot in a deleted entry or with a nonexistent com

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

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

One more check, and we're done.

Patch by [personal profile] fu.

Files modified:
  • htdocs/go.bml
--------------------------------------------------------------------------------
diff -r 8c3aebd4accd -r 3c06a8f818d7 htdocs/go.bml
--- a/htdocs/go.bml	Tue May 17 13:14:19 2011 +0800
+++ b/htdocs/go.bml	Tue May 17 13:35:30 2011 +0800
@@ -52,7 +52,10 @@
     }
 
     my $threadroot = LJ::Comment->new( $u, jtalkid => $comment->threadrootid );
-    return BML::redirect(  $threadroot->url( LJ::viewing_style_args( %GET ) ) );
+    my $url = eval { $threadroot->url( LJ::viewing_style_args( %GET ) ) };
+    return if $@;
+
+    return BML::redirect( $url );
  }
   
  # prev/next talkread links
--------------------------------------------------------------------------------