LCL: Prevent an out of bounds error in ValueListEditor when adding rows automatically in Value-column.

git-svn-id: trunk@44714 -
This commit is contained in:
juha 2014-04-13 10:35:15 +00:00
parent e64fe7ef92
commit e7cc950b13

View File

@ -695,9 +695,12 @@ begin
if i = -1 then if i = -1 then
raise Exception.Create('TValueListStrings.GetItemProp: Key not found: '+s); raise Exception.Create('TValueListStrings.GetItemProp: Key not found: '+s);
end; end;
Result := FItemProps.Items[i]; if i < FItemProps.Count then
if not Assigned(Result) then begin
Raise Exception.Create(Format('TValueListStrings.GetItemProp: Index=%d Result=Nil',[i])); Result := FItemProps.Items[i];
if not Assigned(Result) then
Raise Exception.Create(Format('TValueListStrings.GetItemProp: Index=%d Result=Nil',[i]));
end;
end; end;
end; end;