From f32fbcaf5d8a26c3299a3a65851b18e8f1612d35 Mon Sep 17 00:00:00 2001 From: juha Date: Wed, 24 Dec 2014 22:02:01 +0000 Subject: [PATCH] IDE: Check for non-existent components when filling component palette. Prevents crash when a package has been uninstalled. git-svn-id: trunk@47242 - --- ide/componentpalette.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ide/componentpalette.pas b/ide/componentpalette.pas index d7cb780bf7..79c884d87c 100644 --- a/ide/componentpalette.pas +++ b/ide/componentpalette.pas @@ -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