Don't attempt to get surrounding text of error when we don't have access to script string anymore.

This commit is contained in:
Deukhoofd committed 2019-02-21 12:19:11 +01:00
1 parent 40745a1935
commit f1ae0af244
1 file changed
+3 -1
+3 -1
View File
@@ -33,7 +33,9 @@ namespace Upsilon
{
if (ThrowsOnError)
{
var text = ScriptString.GetSpan(location);
string text = string.Empty;
if (ScriptString != null)
text = ScriptString.GetSpan(location);
throw new ParseException(FileName, message, location.StartLine, location.StartPosition, text);
}
Log(DiagnosticLevel.Error, message, location);