From ca283aee1ddbeb2d8be280bb984c0f2ddad387df Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 18 May 2011 05:48:50 +0000 Subject: [PATCH] Try to fix situations when the database tab gets repainted with no active connection. Fixes issue #2417. --- source/main.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/main.pas b/source/main.pas index 3eaf13c8..01cb8891 100644 --- a/source/main.pas +++ b/source/main.pas @@ -7868,9 +7868,11 @@ begin vt := Sender as TVirtualStringTree; if vt.Tag = VTREE_LOADED then Exit; + Conn := ActiveConnection; + if Conn = nil then + Exit; Screen.Cursor := crHourglass; vt.Clear; - Conn := ActiveConnection; try if Conn.InformationSchemaObjects.IndexOf('SCHEMATA') > -1 then AllDatabasesDetails := Conn.GetResults('SELECT * FROM '+Conn.QuoteIdent(DBNAME_INFORMATION_SCHEMA)+'.'+Conn.QuoteIdent('SCHEMATA'));