Skip to content

Commit

Permalink
Fix NullReferenceException
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshihiroIto committed Jan 12, 2025
1 parent 0577dc5 commit ce73612
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TextMateSharp/Model/TMModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@ public bool IsLineInvalid(int lineIndex)

public void InvalidateLine(int lineIndex)
{
this._lines.Get(lineIndex).IsInvalid = true;
var line = this._lines.Get(lineIndex);
if (line == null)
return;

line.IsInvalid = true;

lock (_lock)
{
Expand Down

0 comments on commit ce73612

Please # to comment.