j178 / chatgpt

An elegant interactive CLI for ChatGPT
728 stars 54 forks source link

runtime error: invalid memory address or nil pointer dereference #14

Closed Sakurageng closed 1 year ago

Sakurageng commented 1 year ago

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x64 runtime/debug.PrintStack() runtime/debug/stack.go:16 +0x1c github.com/charmbracelet/bubbletea.(Program).Run.func1() github.com/charmbracelet/bubbletea@v0.23.2/tea.go:402 +0x88 panic({0x102cfee80, 0x1031d7e30}) runtime/panic.go:890 +0x248 github.com/sashabaranov/go-gpt3.(ChatCompletionStream).Close(...) github.com/sashabaranov/go-gpt3@v1.3.3/chat_stream.go:78 main.(chatGPT).answerDone(0x1400039a7d0) github.com/j178/chatgpt/main.go:169 +0x20 main.model.Update({{0x50, 0x16, {{{...}, {...}, 0x0}, {{...}, {...}, 0x0}, {{...}, {...}, ...}, ...}, ...}, ...}, ...) github.com/j178/chatgpt/main.go:340 +0x98c github.com/charmbracelet/bubbletea.(Program).eventLoop(0x14000140420, {0x102d77500?, 0x140001a4c00?}, 0x1025467e4?) github.com/charmbracelet/bubbletea@v0.23.2/tea.go:343 +0x57c github.com/charmbracelet/bubbletea.(*Program).Run(0x14000140420) github.com/charmbracelet/bubbletea@v0.23.2/tea.go:465 +0x674 main.main() github.com/j178/chatgpt/main.go:66 +0x47c (base) sweeti@sweetideMacBook-Pro chatgpt_Darwin_arm64 %

j178 commented 1 year ago

Hi, this should be fixed in v0.2.1, could you try that?