IDE: Check for non-existent components when filling component palette. Prevents crash when a package has been uninstalled.

git-svn-id: trunk@47242 -
This commit is contained in:
juha 2014-12-24 22:02:01 +00:00
parent 3adae1d6f9
commit f32fbcaf5d

View File

@ -584,7 +584,8 @@ begin
Assert(Assigned(fCompNames), 'TComponentPage.CreateButtons: fCompNames is not assigned.');
for i := 0 to fCompNames.Count-1 do begin
Comp := Pal.FindComponent(fCompNames[i]) as TPkgComponent;
CreateOrDelButton(Comp, Format('%d_%d_',[fIndex,i]), ScrollBox);
if Assigned(Comp) then
CreateOrDelButton(Comp, Format('%d_%d_',[fIndex,i]), ScrollBox);
end;
fGuiCreated := True;
end;
@ -1083,8 +1084,7 @@ begin
for CompI := 0 to CompNames.Count-1 do
begin
Comp := FindComponent(CompNames[CompI]);
Assert(Assigned(Comp),
Format('TComponentPalette.CreatePagesFromUserOrder: Comp %s not found.',[CompNames[CompI]]));
if not Assigned(Comp) then Continue;
Comp.RealPage := Pg;
UserComps.AddObject(CompNames[CompI], Comp);
if VoteCompVisibility(Comp) then