diff --git a/lcl/checklst.pas b/lcl/checklst.pas index 262023bc9f..d88f834aff 100644 --- a/lcl/checklst.pas +++ b/lcl/checklst.pas @@ -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];