Skip to content

Commit

Permalink
Merge pull request #19 from danipen/fix-nre-grammar
Browse files Browse the repository at this point in the history
Fixed NRE when grammar is still not set
  • Loading branch information
danipen authored May 17, 2022
2 parents cd46c5c + b00a60c commit d8e55dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TextMateSharp/Model/TMModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public int UpdateTokensInRange(ModelTokensChangedEventBuilder eventBuilder, int
int lineIndex = startIndex;
while (lineIndex <= endLineIndex && lineIndex < model._lines.GetNumberOfLines())
{
if (model._grammar.IsCompiling)
if (model._grammar != null && model._grammar.IsCompiling)
{
lineIndex++;
continue;
Expand Down

0 comments on commit d8e55dc

Please sign in to comment.