check for db connection before assuming that dbh is valid
This commit is contained in:
parent
aebfa5c237
commit
aaa4b3a824
|
@ -78,8 +78,7 @@ sub zmDbConnect
|
|||
{
|
||||
zmDbDisconnect();
|
||||
}
|
||||
if ( !defined( $dbh ) )
|
||||
{
|
||||
if ( ( ! defined( $dbh ) ) or ! $dbh->ping() ) {
|
||||
my ( $host, $port ) = ( $ZoneMinder::Config::Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||
|
||||
if ( defined($port) )
|
||||
|
|
Loading…
Reference in New Issue