Commit 61392ff8 authored by Željan Rikalo's avatar Željan Rikalo 🏊🏼
Browse files

LCL: fixed AV on TCheckListBox when key space is pressed to check/uncheck...

LCL: fixed AV on TCheckListBox when key space is pressed to check/uncheck item, and itemindex=-1. issue #24627

git-svn-id: trunk@41771 -
parent f0b282db
......@@ -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];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment