diff --git a/source/main.pas b/source/main.pas index 5278a7f0..5f6ac0b8 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6695,7 +6695,8 @@ var Proposal: TSynCompletionProposal; begin Proposal := Sender as TSynCompletionProposal; - Proposal.Title := Proposal.InsertItem(AIndex); + if (AIndex >= 0) and (AIndex < Proposal.ItemList.Count) then + Proposal.Title := Proposal.InsertItem(AIndex); end;