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:
zeljko 2013-06-21 06:04:22 +00:00
parent f0b282dbd0
commit 61392ff806

View File

@ -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];