tvplanit: Fix fulldemo with resource groups crashing due to nil resources.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5161 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-09-14 22:39:33 +00:00
parent 211225aed9
commit f436b26383
2 changed files with 13 additions and 5 deletions

View File

@ -819,6 +819,7 @@ var
i: Integer;
event: TVpEvent;
id: Integer;
res: TVpResource;
begin
Resource.Schedule.ClearGroupEvents;
@ -828,11 +829,17 @@ begin
end;
for i:=0 to Resource.Group.Count-1 do begin
id := Resource.Group[i].ResourceID;
// current resource of group
res := Resource.Group[i];
if res <> nil then begin
id := res.ResourceID;
// Ignore active resource in group
if id = ResourceID then
exit;
Continue;
// Load events of the current resource of the group
LoadEventsOfResource(id);
end;
end;
NotifyDependents;
end;

View File

@ -752,6 +752,7 @@ begin
if ACaption = '' then begin
for i:=Low(AResIDs) + 1 to High(AResIDs) do begin
res := GetResource(AResIDs[i]);
if res <> nil then
ACaption := ACaption + ', ' + res.Description;
end;
if ACaption <> '' then Delete(ACaption, 1, 2);