From 66d4e2051e56e7977c22b0a51a68b1cc9ac2392d Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 19 Oct 2023 19:43:46 +0200 Subject: [PATCH] Try to fix another crash in DBtreeFocusChanged (FActiveObjectGroup := ParentDBObj.GroupType) --- source/dbconnection.pas | 1 + source/main.pas | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 8f91f1b3..fc03af43 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -9942,6 +9942,7 @@ end; constructor TDBObject.Create(OwnerConnection: TDBConnection); begin NodeType := lntNone; + GroupType := lntNone; Name := ''; Database := ''; Schema := ''; diff --git a/source/main.pas b/source/main.pas index 0fb6bf6e..b618339b 100644 --- a/source/main.pas +++ b/source/main.pas @@ -9562,7 +9562,7 @@ begin DBObj.WasSelected := True; FActiveDbObj := TDBObject.Create(DBObj.Connection); FActiveDbObj.Assign(DBObj^); - if Assigned(Node.Parent) then + if Assigned(Node.Parent) and (DBtree.GetNodeLevel(Node) > 0) then ParentDBObj := Sender.GetNodeData(Node.Parent); case FActiveDbObj.NodeType of