FIX: Crash with Lazarus 4.99 (fixes #2764)

This commit is contained in:
Alexander Koblov 2026-02-24 17:54:33 +03:00
commit 927ed4ad8d

View file

@ -446,10 +446,19 @@ end;
procedure TSynUniSyn.SetRange(Value: Pointer);
//: Set current range
{$if lcl_fullversion >= 4990000}
var
Index: Integer;
{$endif}
begin
{$if lcl_fullversion >= 4990000}
// Workaround, issue #2764
if (Value = nil) then Exit;
if (Value = nil) then
begin
Index:= LineIndex - 1;
PrepareLines(-1, 100);
Value:= CurrentRanges[Index];
end;
{$endif}
fCurrentRule := TSynRange(Value);
end;