mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 18:09:35 +02:00
TProjectResources: prevent crash when having invalid resource files
This commit is contained in:
parent
666ab2572e
commit
d4d30d7e31
@ -833,7 +833,15 @@ begin
|
||||
ResStream := TMemoryStream.Create;
|
||||
Writer := TResResourceWriter.Create;
|
||||
try
|
||||
FSystemResources.WriteToStream(ResStream, Writer);
|
||||
try
|
||||
FSystemResources.WriteToStream(ResStream, Writer);
|
||||
except
|
||||
on E: Exception do
|
||||
begin
|
||||
debugln('TProjectResources.UpdateResCodeBuffer exception %s: %s', [E.ClassName, E.Message]);
|
||||
ResStream.Size := 0;
|
||||
end;
|
||||
end;
|
||||
ResStream.Position := 0;
|
||||
CodeBuf.LoadFromStream(ResStream);
|
||||
Result := CodeBuf.Source <> LastSavedRes;
|
||||
|
Loading…
Reference in New Issue
Block a user