From e7cc950b13a9840688769c53c6449ffa9ea2dfec Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 13 Apr 2014 10:35:15 +0000 Subject: [PATCH] LCL: Prevent an out of bounds error in ValueListEditor when adding rows automatically in Value-column. git-svn-id: trunk@44714 - --- lcl/valedit.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lcl/valedit.pas b/lcl/valedit.pas index c86317d6d1..a12a1f1382 100644 --- a/lcl/valedit.pas +++ b/lcl/valedit.pas @@ -695,9 +695,12 @@ begin if i = -1 then raise Exception.Create('TValueListStrings.GetItemProp: Key not found: '+s); end; - Result := FItemProps.Items[i]; - if not Assigned(Result) then - Raise Exception.Create(Format('TValueListStrings.GetItemProp: Index=%d Result=Nil',[i])); + if i < FItemProps.Count then + begin + Result := FItemProps.Items[i]; + if not Assigned(Result) then + Raise Exception.Create(Format('TValueListStrings.GetItemProp: Index=%d Result=Nil',[i])); + end; end; end;