From e38d3c9b03d6543a6cc5631989f4f55889b607da Mon Sep 17 00:00:00 2001 From: ondrej Date: Mon, 18 Jun 2018 10:41:36 +0000 Subject: [PATCH] VirtualTrees: fix AV in AutoScale if handle cannot be allocated (e.g. Parent is not set) git-svn-id: trunk@58304 - --- components/virtualtreeview/VirtualTrees.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/virtualtreeview/VirtualTrees.pas b/components/virtualtreeview/VirtualTrees.pas index bb888395db..5fd1152522 100644 --- a/components/virtualtreeview/VirtualTrees.pas +++ b/components/virtualtreeview/VirtualTrees.pas @@ -25604,7 +25604,7 @@ procedure TBaseVirtualTree.AutoScale(); var lTextHeight: Cardinal; begin - if (toAutoChangeScale in TreeOptions.AutoOptions) then + if (toAutoChangeScale in TreeOptions.AutoOptions) and HandleAllocated then begin Canvas.Font.Assign(Self.Font); lTextHeight := Canvas.TextHeight('Tg');