From cbad56f94b46cb96d21642b9fd13803b2cc895fb Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Tue, 14 Jun 2022 12:36:43 -0700 Subject: [PATCH] fix: get jobs that are valid GUIDs This ensures we retrieve a list of jobs that are valid GUIDs. Previously, if there were jobs named like "hippo", "traefik", or "bindle", GetJobs() would return null. Signed-off-by: Matthew Fisher --- src/Infrastructure/Services/NomadJobService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Infrastructure/Services/NomadJobService.cs b/src/Infrastructure/Services/NomadJobService.cs index 4f69f841b..923bb1b70 100644 --- a/src/Infrastructure/Services/NomadJobService.cs +++ b/src/Infrastructure/Services/NomadJobService.cs @@ -192,6 +192,7 @@ private Fermyon.Nomad.Model.Task GenerateJobTask(NomadJob nomadJob) try { var jobs = _jobsClient.GetJobs() + .Where(job => Guid.TryParse(job.ID, out _)) .Select(job => new NomadJob(_configuration, Guid.Parse(job.ID), string.Empty, string.Empty,