mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 20:40:20 +02:00
prevent exception when component image cannot be found (this will be improved)
git-svn-id: trunk@12954 -
This commit is contained in:
parent
980c6a4889
commit
84b91e501e
@ -45,7 +45,7 @@ unit PackageDefs;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LResources, Graphics,
|
||||
Classes, SysUtils, LCLProc, LResources, Graphics,
|
||||
AVL_Tree, Laz_XMLCfg,
|
||||
DefineTemplates, CodeToolManager, EditDefineTree, CompilerOptions, Forms,
|
||||
FileUtil,
|
||||
@ -3408,7 +3408,11 @@ end;
|
||||
|
||||
function TPkgComponent.GetIconCopy: TBitMap;
|
||||
begin
|
||||
Result := LoadBitmapFromLazarusResource(ComponentClass.ClassName);
|
||||
if LazarusResources.Find(ComponentClass.ClassName) <> nil then
|
||||
Result := LoadBitmapFromLazarusResource(ComponentClass.ClassName)
|
||||
else
|
||||
Result := nil;
|
||||
|
||||
if Result = nil then
|
||||
Result := LoadBitmapFromLazarusResource('default');
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user