tvplanit: Fix index error when default category in ical event import is empty.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8383 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-08-12 09:57:38 +00:00
parent 5d091a3a05
commit f21be3532a

View File

@ -250,7 +250,7 @@ begin
begin
SizePriority := 0;
Width := 160;
Title.Caption := 'Category';
Title.Caption := 'Category to be applied';
ButtonStyle := cbsPickList;
L := TStringList.Create;
try
@ -267,7 +267,10 @@ begin
event := TVpICalEvent(FItems[i]);
cat := FDatastore.FindBestEventCategory(event.Categories);
if cat = '' then cat := FDefaultCategory;
event.PickedCategory := Grid.Columns[2].PickList.IndexOf(cat)
if cat <> '' then
event.PickedCategory := Grid.Columns[2].PickList.IndexOf(cat)
else
event.PickedCategory := 0;
end;
end;
end;