mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 20:59:17 +02:00
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:
parent
3adae1d6f9
commit
f32fbcaf5d
@ -584,7 +584,8 @@ begin
|
|||||||
Assert(Assigned(fCompNames), 'TComponentPage.CreateButtons: fCompNames is not assigned.');
|
Assert(Assigned(fCompNames), 'TComponentPage.CreateButtons: fCompNames is not assigned.');
|
||||||
for i := 0 to fCompNames.Count-1 do begin
|
for i := 0 to fCompNames.Count-1 do begin
|
||||||
Comp := Pal.FindComponent(fCompNames[i]) as TPkgComponent;
|
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;
|
end;
|
||||||
fGuiCreated := True;
|
fGuiCreated := True;
|
||||||
end;
|
end;
|
||||||
@ -1083,8 +1084,7 @@ begin
|
|||||||
for CompI := 0 to CompNames.Count-1 do
|
for CompI := 0 to CompNames.Count-1 do
|
||||||
begin
|
begin
|
||||||
Comp := FindComponent(CompNames[CompI]);
|
Comp := FindComponent(CompNames[CompI]);
|
||||||
Assert(Assigned(Comp),
|
if not Assigned(Comp) then Continue;
|
||||||
Format('TComponentPalette.CreatePagesFromUserOrder: Comp %s not found.',[CompNames[CompI]]));
|
|
||||||
Comp.RealPage := Pg;
|
Comp.RealPage := Pg;
|
||||||
UserComps.AddObject(CompNames[CompI], Comp);
|
UserComps.AddObject(CompNames[CompI], Comp);
|
||||||
if VoteCompVisibility(Comp) then
|
if VoteCompVisibility(Comp) then
|
||||||
|
Loading…
Reference in New Issue
Block a user