Skip to content

Commit 803b8b2

Browse files
author
Rajesh Jinaga
committed
Fix captured error issue
1 parent 5dd2b06 commit 803b8b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Simpleflow/CodeGenerator/SimpleflowErrorListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override void SyntaxError(TextWriter output, IRecognizer recognizer, ITok
1717
string msg, RecognitionException e)
1818
{
1919

20-
if (recognizer.Atn.states[e.OffendingState].StateType == Antlr4.Runtime.Atn.StateType.BlockStart)
20+
if (e != null && recognizer.Atn.states[e.OffendingState].StateType == Antlr4.Runtime.Atn.StateType.BlockStart)
2121
{
2222
Errors.Add(new SyntaxError(recognizer, offendingSymbol, line, charPositionInLine, $"Unexpected token {offendingSymbol.Text}, a newline expected", e));
2323
}

0 commit comments

Comments
 (0)