Skip to content

Commit

Permalink
Autoload didn't always find the key/value pair
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 21, 2024
1 parent 78b53fd commit 438c096
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dynamic-site/lib/Ged2site/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ sub AUTOLOAD
our $AUTOLOAD;
my $self = shift;

return undef unless($self);

# Extract the method name from the AUTOLOAD variable
(my $key = $AUTOLOAD) =~ s/.*:://;

# Return undef if $self is not a hash reference
return undef unless(ref($self) eq 'HASH');

# Return the value of the corresponding hash key
return $self->{$key};
}
Expand Down

0 comments on commit 438c096

Please sign in to comment.