Subject: | Contents module |
if Solaris::Contents->pkgs($file) is called where $file is not part of a package an error is generated.
Can't use an undefined value as and ARRAY refernce at Contents.pm line 133.
The context diff I included tests the var before the return @{$self->{...} } for being defined, and returns () otherwise.
cheers,
Matt Kleifgen
*** Contents.old Tue May 6 12:17:59 2003
--- Contents.pm Tue May 6 12:17:40 2003
***************
*** 130,136 ****
sub pkgs
{
my ($self,$file)=@_;
! return(@{$self->{"db"}->{$file}->{"pkgs"}});
}
#
--- 130,140 ----
sub pkgs
{
my ($self,$file)=@_;
! if (defined(my $pkgs = $self->{"db"}->{$file}->{"pkgs"})) {
! return(@{$self->{"db"}->{$file}->{"pkgs"}});
! } else {
! return ();
! }
}
#