fix: deploy keys modal crash on null/undefined arrays

- sshmanager/deploy.go: initialize DeployResult with empty slices
  instead of nil to prevent null serialization in JSON
- Machines.tsx: use ?? [] fallback for messages and errors arrays
  in deploy keys modal to handle null/undefined gracefully
This commit is contained in:
2026-07-09 20:38:41 -04:00
parent c0bf16f132
commit 179b2d8fbd
3 changed files with 176 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ type DeployResult struct {
}
func DeployKeysToMachine(ctx context.Context, serverKeyPath, serverPubKey string, host string, port int, user string, keys []DeployKey, knownHostsHost string, addServerPubKey bool) (*DeployResult, error) {
result := &DeployResult{Success: true}
result := &DeployResult{Success: true, Messages: []string{}, Errors: []string{}}
addr := fmt.Sprintf("%s:%d", host, port)