You've already forked lazarus-ccr
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:
@@ -819,6 +819,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
event: TVpEvent;
|
event: TVpEvent;
|
||||||
id: Integer;
|
id: Integer;
|
||||||
|
res: TVpResource;
|
||||||
begin
|
begin
|
||||||
Resource.Schedule.ClearGroupEvents;
|
Resource.Schedule.ClearGroupEvents;
|
||||||
|
|
||||||
@@ -828,10 +829,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
for i:=0 to Resource.Group.Count-1 do begin
|
for i:=0 to Resource.Group.Count-1 do begin
|
||||||
id := Resource.Group[i].ResourceID;
|
// current resource of group
|
||||||
if id = ResourceID then
|
res := Resource.Group[i];
|
||||||
exit;
|
if res <> nil then begin
|
||||||
LoadEventsOfResource(id);
|
id := res.ResourceID;
|
||||||
|
// Ignore active resource in group
|
||||||
|
if id = ResourceID then
|
||||||
|
Continue;
|
||||||
|
// Load events of the current resource of the group
|
||||||
|
LoadEventsOfResource(id);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
NotifyDependents;
|
NotifyDependents;
|
||||||
|
@@ -752,7 +752,8 @@ begin
|
|||||||
if ACaption = '' then begin
|
if ACaption = '' then begin
|
||||||
for i:=Low(AResIDs) + 1 to High(AResIDs) do begin
|
for i:=Low(AResIDs) + 1 to High(AResIDs) do begin
|
||||||
res := GetResource(AResIDs[i]);
|
res := GetResource(AResIDs[i]);
|
||||||
ACaption := ACaption + ', ' + res.Description;
|
if res <> nil then
|
||||||
|
ACaption := ACaption + ', ' + res.Description;
|
||||||
end;
|
end;
|
||||||
if ACaption <> '' then Delete(ACaption, 1, 2);
|
if ACaption <> '' then Delete(ACaption, 1, 2);
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user