Skip to content

Commit

Permalink
fix GetJobs for PipelineClient mock (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
phdesroUbi authored Jun 17, 2021
1 parent 8a87dba commit e8abc85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NGitLab.Mock/Clients/PipelineClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public Models.Job[] GetJobs(int pipelineId)
using (Context.BeginOperationScope())
{
var jobs = _jobClient.GetJobs(JobScopeMask.All).Where(j => j.Pipeline.Id == query.PipelineId);
return !query.Scope.Any() ? jobs : jobs.Where(j => query.Scope.Contains(j.Status.ToString(), StringComparer.Ordinal));
return (query.Scope == null || !query.Scope.Any()) ? jobs : jobs.Where(j => query.Scope.Contains(j.Status.ToString(), StringComparer.Ordinal));
}
}

Expand Down

0 comments on commit e8abc85

Please sign in to comment.