Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nil check pkg components in TUI #538

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading