Skip to content

Commit

Permalink
Protect exceptions when notifying the IModelTokensChangedListener
Browse files Browse the repository at this point in the history
  • Loading branch information
danipen committed Jan 20, 2022
1 parent bf52c75 commit a8369f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/TextMateSharp/Model/TMModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,14 @@ private void Emit(ModelTokensChangedEvent e)
{
foreach (IModelTokensChangedListener listener in listeners)
{
listener.ModelTokensChanged(e);
try
{
listener.ModelTokensChanged(e);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
}

Expand Down

0 comments on commit a8369f3

Please sign in to comment.