fix: check for nil pointer in AwaitWorkspaceAgents

CompletedAt is a pointer and can be nil, need to check before calling IsZero() on it

c.f. https://github.com/coder/coder/runs/17534657301
This commit is contained in:
Spike Curtis
2023-10-09 22:12:28 +04:00
committed by GitHub
parent 584a2e87c9
commit b9c7bc4d3c

View File

@ -857,6 +857,9 @@ func AwaitWorkspaceAgents(t testing.TB, client *codersdk.Client, workspaceID uui
if !assert.NoError(t, err) {
return false
}
if workspace.LatestBuild.Job.CompletedAt == nil {
return false
}
if workspace.LatestBuild.Job.CompletedAt.IsZero() {
return false
}