Permalink
Browse files

Prevent crash when resizing query helpers box in an early stage of cr…

…eating a new query tab. Closes #466
  • Loading branch information...
ansgarbecker committed Jan 5, 2019
1 parent ab67e03 commit 0e3d36dc6f431fd11d72c69926c2695f6d6deb40
Showing with 6 additions and 1 deletion.
  1. +6 −1 source/main.pas
@@ -11725,8 +11725,13 @@ procedure TMainForm.treeQueryHelpersResize(Sender: TObject);
var
Tree: TVirtualStringTree;
begin
// Resizing query helpers box: Keep second column at a minimum width.
Tree := Sender as TVirtualStringTree;
Tree.Header.Columns[1].Width := Min(Tree.Width div 3, 100);
if Tree.Header.Columns.Count >= 2 then begin
// See https://github.com/HeidiSQL/HeidiSQL/issues/466
// Column count may be 0 in an early stage of creating a new query tab
Tree.Header.Columns[1].Width := Min(Tree.Width div 3, 100);
end;
end;


0 comments on commit 0e3d36d

Please sign in to comment.