Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: Exception "TList<System.Integer> is empty" #262

Open
ma3as opened this issue Sep 18, 2024 · 1 comment
Open

fixed: Exception "TList<System.Integer> is empty" #262

ma3as opened this issue Sep 18, 2024 · 1 comment

Comments

@ma3as
Copy link

ma3as commented Sep 18, 2024

With create a new project there seems no problem.

When I open my project with the SynEdit component, the IDE shows me an error, before the Designer is ready.
Also when run the project, while create the form where the SynEdit is placed on (sorry is german):

Exception: EArgumentOutOfRangeException mit der Meldung 'Listenindex außerhalb des gültigen Bereichs (0). TList<System.Integer> ist leer' aufgetreten.

It happens in the unit SynEditWordWrap, here:

function TSynWordWrapPlugin.RowCount: integer;
begin
  if fLineCount > 0 then
    Result := fLineOffsets[fLineCount - 1]   // here it crashing
  else
    Result := 0;
  Assert(fRowLengths.Count = Result);
end;

Compiled with Delphi 10.1 Berlin there was no problem - now I use 12.2 Athens and it shows the error.

How to fix?

@ma3as
Copy link
Author

ma3as commented Sep 23, 2024

Hi,
I fixed that issue for me:
if (fLineOffsets.Count > 0) // and (fLineCount > 0)

Now it works without Exception.

@ma3as ma3as changed the title Crash: TList<System.Integer> is empty fixed: Exception "TList<System.Integer> is empty" Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant