Sometimes cause internal server error

Hello.
Error:
Can’t call method “ping” on an undefined value at
/www/rt3//lib/RT.pm line 122.
Quick patch without looking for root of problem:
— lib/RT.pm.orig Mon Aug 4 15:53:08 2003
+++ lib/RT.pm Mon Aug 4 15:53:33 2003
@@ -119,7 +119,7 @@
sub Init {
require RT::Handle;
#Get a database connection

  •    unless ($Handle && $Handle->dbh->ping) {
    
  •    unless ($Handle && $Handle->dbh && $Handle->dbh->ping) {
    

    $Handle = RT::Handle->new();
    }
    $Handle->Connect();

          Best regards. Ruslan.