Skip to content

生成时,一按方向键就会程序崩溃 #11

@MaoJianwei

Description

@MaoJianwei
Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:26 +0x5e
charm.land/bubbletea/v2.(*Program).recoverFromPanic(0x9b727a84780, {0x1282ba0, 0x245f080})
        /Users/du/go/pkg/mod/charm.land/bubbletea/v2@v2.0.2/tea.go:1260 +0x151
charm.land/bubbletea/v2.(*Program).Run.func2()
        /Users/du/go/pkg/mod/charm.land/bubbletea/v2@v2.0.2/tea.go:1011 +0x10c
panic({0x1282ba0?, 0x245f080?})
        /usr/local/go/src/runtime/panic.go:860 +0x13a
charm.land/bubbles/v2/list.(*Model).handleBrowsing(0x9b727bd4008, {0x13a5b80?, 0x9b727a251d0?})

charm.land/bubbles/v2/list.Model.Update({0x0, 0x0, 0x0, 0x0, 0x0, 0x0, {0x0, 0x0}, {0x0, 0x0}, ...}, ...)
        /Users/du/go/pkg/mod/charm.land/bubbles/v2@v2.0.0/list/list.go:846 +0x5ef
zread_cli/pkg/ui/generate.GenerateCmdModel.handleKey({{{0x14276db, 0x7}, 0x0, {{0x141eae6, 0x5}, {0x0, 0x0}, 0x0, 0x0, {0x0, ..
.}}, ...}, ...}, ...)
        /Users/du/repos/zread_cli/pkg/ui/generate/tui.go:284 +0x7a7
zread_cli/pkg/ui/generate.GenerateCmdModel.Update({{{0x14276db, 0x7}, 0x0, {{0x141eae6, 0x5}, {0x0, 0x0}, 0x0, 0x0, {0x0, ...}}
, ...}, ...}, ...)
        /Users/du/repos/zread_cli/pkg/ui/generate/tui.go:105 +0x45a
charm.land/bubbletea/v2.(*Program).eventLoop(0x9b727a84780, {0x1774228?, 0x9b727880008?}, 0x9b7276bc2a0)
        /Users/du/go/pkg/mod/charm.land/bubbletea/v2@v2.0.2/tea.go:853 +0xe46
charm.land/bubbletea/v2.(*Program).Run(0x9b727a84780)
        /Users/du/go/pkg/mod/charm.land/bubbletea/v2@v2.0.2/tea.go:1125 +0xab0
zread_cli/pkg/cmd.runGenerateProgram({0x1777bd8, 0x262e520}, {0x1, {0x7ffcc5d661ea, 0x5}, 0x0, {0x0, 0x0}}, 0x0)
        /Users/du/repos/zread_cli/pkg/cmd/generate.go:82 +0x758
zread_cli/pkg/cmd.NewGenerateCmd.func1(0x9b727c62c08?, {0x141d13a?, 0x4?, 0x141d0de?})
        /Users/du/repos/zread_cli/pkg/cmd/generate.go:31 +0x58
github.com/spf13/cobra.(*Command).execute(0x9b727c62c08, {0x9b7276c02a0, 0x3, 0x3})
        /Users/du/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1019 +0xafb
github.com/spf13/cobra.(*Command).ExecuteC(0x2477b20)
        /Users/du/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/du/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /Users/du/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1064
zread_cli/pkg/cmd.Execute()
        /Users/du/repos/zread_cli/pkg/cmd/root.go:30 +0x4f
main.main()
        /Users/du/repos/zread_cli/cmd/zread/main.go:53 +0x18f


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions