Skip to content

Commit

Permalink
Fix Appveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Sep 13, 2024
1 parent 5436965 commit 1d85f41
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Genealogy/ObituaryDailyTimes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ sub new {
return bless { %{$class}, %args }, ref($class);
}

if(!defined((my $directory = ($args{'directory'} || $Database::Abstraction->{'directory'})))) {
my $directory = $args{'directory'} || $Database::Abstraction->{'directory'};
if(!defined($directory)) {
# If the directory argument isn't given, see if we can find the data
$directory ||= Module::Info->new_from_loaded(__PACKAGE__)->file();
$directory = Module::Info->new_from_loaded(__PACKAGE__)->file();
$directory =~ s/\.pm$//;
$args{'directory'} = File::Spec->catfile($directory, 'data');
}
if(!-d $args{'directory'}) {
Carp::carp(__PACKAGE__, ': ', $args{'directory'}, ' is not a directory');
if(!-d $directory) {
Carp::carp(__PACKAGE__, ": $directory is not a directory");
return;
}

Expand Down

0 comments on commit 1d85f41

Please sign in to comment.