[Codestriker-commits] CVS update: codestriker/lib/Codestriker/TopicListeners Email.pm
Brought to you by:
sits
|
From: <si...@us...> - 2008-08-15 00:14:09
|
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, \@text);
- 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, \@text);
+ 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";
|