Skip to content

Commit b9c7bc4

Browse files
authored
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
1 parent 584a2e8 commit b9c7bc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

coderd/coderdtest/coderdtest.go

+3
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ func AwaitWorkspaceAgents(t testing.TB, client *codersdk.Client, workspaceID uui
857857
if !assert.NoError(t, err) {
858858
return false
859859
}
860+
if workspace.LatestBuild.Job.CompletedAt == nil {
861+
return false
862+
}
860863
if workspace.LatestBuild.Job.CompletedAt.IsZero() {
861864
return false
862865
}

0 commit comments

Comments
 (0)