VirtualTrees: fix AV in AutoScale if handle cannot be allocated (e.g. Parent is not set)

git-svn-id: trunk@58304 -
This commit is contained in:
ondrej 2018-06-18 10:41:36 +00:00
parent 22cab1ecb2
commit e38d3c9b03

View File

@ -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');