From e8abc853bd4a8224fc9448ee5418e31b4f64f8cb Mon Sep 17 00:00:00 2001 From: phdesroUbi <83839027+phdesroUbi@users.noreply.github.com> Date: Thu, 17 Jun 2021 17:48:39 -0400 Subject: [PATCH] fix GetJobs for PipelineClient mock (#26) --- NGitLab.Mock/Clients/PipelineClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NGitLab.Mock/Clients/PipelineClient.cs b/NGitLab.Mock/Clients/PipelineClient.cs index d9ecfb8c..bd5e3d4a 100644 --- a/NGitLab.Mock/Clients/PipelineClient.cs +++ b/NGitLab.Mock/Clients/PipelineClient.cs @@ -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)); } }