Subject: | fix for undefined array ref |
# I got the following result, which prevented the report generation from completing:
mark@sap$ cover -report html
Reading database from /usr/home/mark//cover_db
Devel::Cover: ignoring extra statement
Devel::Cover: ignoring extra subroutine
Devel::Cover: ignoring extra branch
Can't use an undefined value as an ARRAY reference at /usr/local/lib/perl5/site_perl/5.8.0/mach/Devel/Cover/Branch.pm line 50.
This patch fixes the issue and allowed the report to succeed:
mark@sap$ diff -u /usr/src/.cpan/build/Devel-Cover-0.50/lib/Devel/Cover/Branch.pm /home/mark/tmp/Branch.pm
--- /usr/src/.cpan/build/Devel-Cover-0.50/lib/Devel/Cover/Branch.pm Mon Oct 25 09:09:56 2004
+++ /home/mark/tmp/Branch.pm Tue Nov 23 16:36:58 2004
@@ -47,7 +47,7 @@
my $s = $db->{summary};
- $self->[0] = [0, 0] unless @{$self->[0]};
+ $self->[0] = [0, 0] unless ((ref $self eq 'ARRAY') && @{$self->[0]});
my $t = $self->total;
my $u = $self->uncoverable;
#############
Although later, I still get this warning/error:
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.0/mach/Devel/Cover/Report/Html_minimal.pm line 527, <$in> line 42.
This is on FreeBSD 5.1