mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Fix null errors
This commit is contained in:
@@ -74,7 +74,8 @@ namespace GitHub.Runner.Worker
|
||||
var fileId = templateContext.GetFileId(fileRelativePath);
|
||||
|
||||
// Add this file to the FileTable in executionContext if it hasn't been added already
|
||||
if (fileId > executionContext.FileTable.Count)
|
||||
// we use > since fileID is zero indexed
|
||||
if (fileId > executionContext.FileTable?.Count)
|
||||
{
|
||||
executionContext.FileTable.Add(fileRelativePath);
|
||||
}
|
||||
@@ -297,7 +298,7 @@ namespace GitHub.Runner.Worker
|
||||
}
|
||||
|
||||
// Add the file table from the Execution Context
|
||||
if (executionContext.FileTable.Count > 0)
|
||||
if (executionContext.FileTable?.Count > 0)
|
||||
{
|
||||
for (var i = 0; i < executionContext.FileTable.Count; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user