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();
|
zmDbDisconnect();
|
||||||
}
|
}
|
||||||
if ( !defined( $dbh ) )
|
if ( ( ! defined( $dbh ) ) or ! $dbh->ping() ) {
|
||||||
{
|
|
||||||
my ( $host, $port ) = ( $ZoneMinder::Config::Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
my ( $host, $port ) = ( $ZoneMinder::Config::Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||||
|
|
||||||
if ( defined($port) )
|
if ( defined($port) )
|
||||||
|
|
Loading…
Reference in New Issue