User: sits    
  Date: 08/08/14 17:14:08

  Modified:    lib/Codestriker/TopicListeners Email.pm
  Log:
  Protect case where a comment is being made on a line where we can't retrieve 
the delta for it.
  
  
  
  Index: Email.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Email.pm  10 Aug 2008 12:18:43 -0000      1.31
  +++ Email.pm  15 Aug 2008 00:14:07 -0000      1.32
  @@ -387,19 +387,22 @@
                                                 $comment->{filenumber}, 
                                                 $comment->{fileline}, 
                                                 $comment->{filenew});
  -     my @text = ();
  -     my $offset = $delta->retrieve_context($comment->{fileline}, 
$comment->{filenew}, 
  -                                           $email_context, [EMAIL 
PROTECTED]);
  -     for (my $i = 0; $i <= $#text; $i++) {
  -         if ($i == $offset) {
  -             $text[$i] = "* " . $text[$i];
  -         } else {
  -             $text[$i] = "  " . $text[$i];
  +     
  +     if (defined $delta) {
  +        my @text = ();
  +         my $offset = $delta->retrieve_context($comment->{fileline}, 
$comment->{filenew}, 
  +                                           $email_context, [EMAIL 
PROTECTED]);
  +         for (my $i = 0; $i <= $#text; $i++) {
  +             if ($i == $offset) {
  +                     $text[$i] = "* " . $text[$i];
  +             } else {
  +                     $text[$i] = "  " . $text[$i];
  +             }
            }
  +     $body .= join "\n", @text;
  +         $body .= "\n\n";
  +         $body .= "$EMAIL_HR";
        }
  -     $body .= join "\n", @text;
  -     $body .= "\n\n";
  -     $body .= "$EMAIL_HR";
       }
       $body .= "\n\n";
       
  
  
  

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to