mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Viewer - crash with unreadable file
This commit is contained in:
parent
4d1130f775
commit
e701968cd1
1 changed files with 5 additions and 0 deletions
|
|
@ -1614,6 +1614,11 @@ function TViewerControl.MapFile(const sFileName: String): Boolean;
|
|||
begin
|
||||
FMappedFile := GetMem(FFileSize);
|
||||
Result := (FileRead(FFileHandle, FMappedFile^, FFileSize) = FFileSize);
|
||||
if not Result then
|
||||
begin
|
||||
FLastError := mbSysErrorMessage;
|
||||
FreeMemAndNil(FMappedFile);
|
||||
end;
|
||||
FileClose(FFileHandle);
|
||||
FFileHandle := 0;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue