fix(cli/cliui): avoid nil pointer deref when agent disconnects (#9892)

Fixes #9884
This commit is contained in:
Mathias Fredriksson
2023-09-27 19:10:15 +03:00
committed by GitHub
parent de6d0b9a1a
commit 0878381d0b
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -133,6 +133,7 @@ func TestAgent(t *testing.T) {
},
func(_ context.Context, agent *codersdk.WorkspaceAgent, _ chan []codersdk.WorkspaceAgentLog) error {
agent.Status = codersdk.WorkspaceAgentConnected
agent.DisconnectedAt = nil
agent.LastConnectedAt = ptr.Ref(time.Now())
return nil
},