Skip to content

Commit

Permalink
fix: nil check pkg components in TUI (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 29, 2024
1 parent 932ad3c commit 1385720
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pkg/bundle/tui/deploy/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ func (m *Model) handleDeployTick() (tea.Model, tea.Cmd) {
// check component progress
for j := range deployedPkg.DeployedComponents {
// check numComponents bc there is a slight delay between rendering the TUI and updating this value
if p.numComponents > 0 && deployedPkg.DeployedComponents[j].Status == zarfTypes.ComponentStatusSucceeded {
// also nil check the componentStatuses to avoid panic
componentSucceeded := deployedPkg.DeployedComponents[j].Status == zarfTypes.ComponentStatusSucceeded
if p.numComponents > 0 && len(p.componentStatuses) >= j && componentSucceeded {
m.packages[i].componentStatuses[j] = true
}
}
Expand Down

0 comments on commit 1385720

Please sign in to comment.