mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 16:38:02 +02:00
LCL: fixed AV on TCheckListBox when key space is pressed to check/uncheck item, and itemindex=-1. issue #24627
git-svn-id: trunk@41771 -
This commit is contained in:
parent
f0b282dbd0
commit
61392ff806
@ -303,7 +303,7 @@ procedure TCustomCheckListBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
var
|
||||
Index: Integer;
|
||||
begin
|
||||
if (Key = VK_SPACE) and (Shift=[]) then
|
||||
if (Key = VK_SPACE) and (Shift=[]) and (ItemIndex >= 0) then
|
||||
begin
|
||||
Index := ItemIndex;
|
||||
Checked[Index] := not Checked[Index];
|
||||
|
Loading…
Reference in New Issue
Block a user