mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 19:59:31 +02:00
IDE: fixed crash on GetUnitResourceFileformat when unit not yet loaded
git-svn-id: trunk@40683 -
This commit is contained in:
parent
6b58205bb8
commit
77e0434dd9
@ -2409,19 +2409,24 @@ var
|
|||||||
begin
|
begin
|
||||||
if not assigned(FUnitResourceFileformat) then
|
if not assigned(FUnitResourceFileformat) then
|
||||||
begin
|
begin
|
||||||
ResourceFormats := GetUnitResourcefileFormats;
|
if Source=nil then
|
||||||
for i := 0 to high(ResourceFormats) do
|
Source:=CodeToolBoss.LoadFile(Filename,true,false);
|
||||||
|
if Source<>nil then
|
||||||
begin
|
begin
|
||||||
if ResourceFormats[i].FindResourceDirective(Source) then
|
ResourceFormats := GetUnitResourcefileFormats;
|
||||||
|
for i := 0 to high(ResourceFormats) do
|
||||||
begin
|
begin
|
||||||
FUnitResourceFileformat:=ResourceFormats[i];
|
if ResourceFormats[i].FindResourceDirective(Source) then
|
||||||
result := FUnitResourceFileformat;
|
begin
|
||||||
Exit;
|
FUnitResourceFileformat:=ResourceFormats[i];
|
||||||
|
Result := FUnitResourceFileformat;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
FUnitResourceFileformat := TLFMUnitResourcefileFormat;
|
FUnitResourceFileformat := TLFMUnitResourcefileFormat;
|
||||||
end;
|
end;
|
||||||
result := FUnitResourceFileformat;
|
Result := FUnitResourceFileformat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetAutoReferenceSourceDir(const AValue: boolean);
|
procedure TUnitInfo.SetAutoReferenceSourceDir(const AValue: boolean);
|
||||||
|
Loading…
Reference in New Issue
Block a user