Skip to content

Commit a7808d7

Browse files
committed
fix: pointer exception dereference in enter action
1 parent d0a5165 commit a7808d7

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

internal/ui/wizard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (m WizardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
297297
return m, tea.Batch(cmds...)
298298
}
299299

300-
func (m *WizardModel) handleEnter() (tea.Model, tea.Cmd) {
300+
func (m *WizardModel) handleEnter() (WizardModel, tea.Cmd) {
301301
step := m.steps[m.currentStep]
302302

303303
// Get value based on step type

internal/ui/wizard_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ func TestWizardDisabledSelectOptionCannotBeSubmitted(t *testing.T) {
1515
})
1616

1717
wizard.selectIndex = 1
18-
model, _ := wizard.handleEnter()
19-
updated := model.(*WizardModel)
18+
updated, _ := wizard.handleEnter()
2019

2120
if updated.err == nil {
2221
t.Fatal("expected disabled option to produce an error")

0 commit comments

Comments
 (0)