Subject: | errors during DESTROY |
Catalyst outputs many:
"(in cleanup) Can't use an undefined value as a HASH reference at
/usr/share/perl5/Catalyst/Model/DBI.pm line 84 during global destruction"
messages in the logs.
This is because _dbh is not always defined when DESTROY gets called
(when not using a connection.
Here is the patch I've applied to cancel the errors.
sub DESTROY {
my $self = shift;
$self->disconnect if (defined $self->_dbh);
}