mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 12:29:29 +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
|
||||
if not assigned(FUnitResourceFileformat) then
|
||||
begin
|
||||
ResourceFormats := GetUnitResourcefileFormats;
|
||||
for i := 0 to high(ResourceFormats) do
|
||||
if Source=nil then
|
||||
Source:=CodeToolBoss.LoadFile(Filename,true,false);
|
||||
if Source<>nil then
|
||||
begin
|
||||
if ResourceFormats[i].FindResourceDirective(Source) then
|
||||
ResourceFormats := GetUnitResourcefileFormats;
|
||||
for i := 0 to high(ResourceFormats) do
|
||||
begin
|
||||
FUnitResourceFileformat:=ResourceFormats[i];
|
||||
result := FUnitResourceFileformat;
|
||||
Exit;
|
||||
if ResourceFormats[i].FindResourceDirective(Source) then
|
||||
begin
|
||||
FUnitResourceFileformat:=ResourceFormats[i];
|
||||
Result := FUnitResourceFileformat;
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
FUnitResourceFileformat := TLFMUnitResourcefileFormat;
|
||||
end;
|
||||
result := FUnitResourceFileformat;
|
||||
Result := FUnitResourceFileformat;
|
||||
end;
|
||||
|
||||
procedure TUnitInfo.SetAutoReferenceSourceDir(const AValue: boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user