mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 12:35:55 +02:00
IDE: fix a crash when opening a file with flag [ofRevert] but no editor yet opened for that file.
git-svn-id: trunk@45550 -
This commit is contained in:
parent
291888ad83
commit
baf0ce059f
@ -1349,7 +1349,7 @@ function TLazSourceFileManager.OpenEditorFile(AFileName: string; PageIndex,
|
||||
var
|
||||
UnitIndex: integer;
|
||||
UnknownFile, Handled: boolean;
|
||||
NewUnitInfo:TUnitInfo;
|
||||
NewUnitInfo: TUnitInfo;
|
||||
NewBuf: TCodeBuffer;
|
||||
FilenameNoPath: String;
|
||||
LoadBufferFlags: TLoadBufferFlags;
|
||||
@ -1427,7 +1427,9 @@ begin
|
||||
UseWindowID := False;
|
||||
assert((WindowIndex >= 0) and (WindowIndex < SourceEditorManager.SourceWindowCount), 'WindowIndex for revert');
|
||||
AFilename := SourceEditorManager.SourceEditorsByPage[WindowIndex, PageIndex].FileName;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Flags := Flags - [ofRevert]; // No editor exists yet, don't try to revert.
|
||||
|
||||
UnitIndex:=Project1.IndexOfFilename(AFilename);
|
||||
if (UnitIndex > 0) then begin
|
||||
|
Loading…
Reference in New Issue
Block a user