Skip to content

Commit b739799

Browse files
committed
fix: crash when moving added column to very bottom
Closes #2400
1 parent dbab4cb commit b739799

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/table_editor.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,8 @@ procedure TfrmTableEditor.listColumnsDragDrop(Sender: TBaseVirtualTree;
12171217
NewIndex := FColumns.IndexOf(ToCol^);
12181218
if Mode = dmBelow then
12191219
Inc(NewIndex);
1220+
// Fix crash when moving to very bottom
1221+
NewIndex := Min(NewIndex, FColumns.Count-1);
12201222
FColumns.Move(FColumns.IndexOf(FocusedCol^), NewIndex);
12211223
FocusedCol.Status := esModified;
12221224
Modification(Sender);

0 commit comments

Comments
 (0)