Browse Source

Prevent a crash for empty lines

pull/9896/head
Benedikt Stebner 3 years ago
parent
commit
1e646fd9a0
  1. 2
      src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

2
src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

@ -1438,7 +1438,7 @@ namespace Avalonia.Media.TextFormatting
var lastRunIndex = _textRuns.Count - 1;
if (_textRuns[lastRunIndex] is TextEndOfLine && lastRunIndex > 0)
if (lastRunIndex > 0 && _textRuns[lastRunIndex] is TextEndOfLine)
{
lastRunIndex--;
}

Loading…
Cancel
Save