From: Greg Sabino Mullane Date: Fri, 10 Jul 2009 16:15:34 +0000 (-0400) Subject: Check for existence of fatalregex hash key before using it. X-Git-Tag: 2.9.2~21 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=c5ede9831cf1122ecf8e601c3c5914250e836c86;p=check_postgres.git Check for existence of fatalregex hash key before using it. --- diff --git a/check_postgres.pl b/check_postgres.pl index 1cf302e93..9f4bdb1ca 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1650,7 +1650,7 @@ sub run_command { } if ($db->{error} =~ /FATAL/) { - if ($db->{error} =~ /$arg->{fatalregex}/) { + if (exists $arg->{fatalregex} and $db->{error} =~ /$arg->{fatalregex}/) { $info->{fatalregex} = $db->{error}; next; }