on main help sign in
chore: fix panic on message send
01afa93Kujtim Hoxha
internal/tui/components/chat/editor/editor.go+3
@@ -130,6 +130,9 @@ func (m *editorCmp) Init() tea.Cmd {
130}
130}
131
131
132func (m *editorCmp) send() tea.Cmd {
132func (m *editorCmp) send() tea.Cmd {
133+ if m.app.CoderAgent == nil {
134+ return util.ReportError(fmt.Errorf("coder agent is not initialized"))
135+ }
133 if m.app.CoderAgent.IsSessionBusy(m.session.ID) {
136 if m.app.CoderAgent.IsSessionBusy(m.session.ID) {
134 return util.ReportWarn("Agent is working, please wait...")
137 return util.ReportWarn("Agent is working, please wait...")
135 }
138 }