Issue 1596: Runner throws null ref exception when new line after EOF is missing (#1687)

* Issue 1596: runner throws nullref exception when writting env var

* Adding tests for missing new line after EOF marker

* Changing newline to new line
This commit is contained in:
ruvceskistefan
2022-02-23 15:55:59 +01:00
committed by GitHub
parent 460c32a337
commit ec9830836b
2 changed files with 48 additions and 0 deletions

View File

@@ -181,6 +181,10 @@ namespace GitHub.Runner.Worker
{
throw new Exception($"Invalid environment variable value. Matching delimiter not found '{delimiter}'");
}
if (newline == null)
{
throw new Exception($"Invalid environment variable value. EOF marker missing new line.");
}
endIndex = index - newline.Length;
tempLine = ReadLine(text, ref index, out newline);
}