* fixed crash when trying to load an image type fpimage doesn't support

git-svn-id: trunk@17849 -
This commit is contained in:
andrew 2008-12-16 04:50:15 +00:00
parent 332993241d
commit e059ec103f

View File

@ -139,16 +139,18 @@ begin
FileExt := ExtractFileExt(URL);
Picture := TPicture.Create;
Stream := fChm.GetObject('/'+URL);
try
Stream := fChm.GetObject('/'+URL);
if Assigned(Stream) then
if Assigned(Stream) then
begin
Stream.Position := 0;
Picture.LoadFromStreamWithFileExt(Stream, FileExt);
end;
finally
Stream.Free;
except
// only happens if it's an image type we can't handle
end;
if Stream <> nil then
Stream.Free;
end;
function TIpChmDataProvider.CanHandle(const URL: string): Boolean;