Permalink
Browse files

A DB dir that doesn't exist is valid.

  • Loading branch information...
pjcj committed Aug 9, 2009
1 parent 581b878 commit ad21ef42c90e9bd9c5d6618af86de79d1feabe75
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Devel/Cover/DB.pm
View
@@ -160,7 +160,8 @@ sub validate_db
my $self = shift;
# Check validity of the db. It is valid if the $DB file is there, or if it
- # is not there but the db directory is empty.
+ # is not there but the db directory is empty, or if there is no db
+ # directory.
# die if the db is invalid.
# just warn for now
@@ -173,6 +174,7 @@ sub validate_db
sub is_valid
{
my $self = shift;
+ return 1 if !-e $self->{db};
return 1 if -e "$self->{db}/$DB";
opendir my $fh, $self->{db} or return 0;
for my $file (readdir $fh)

0 comments on commit ad21ef4

Please sign in to comment.