From 71c3e654cfdf9def021d1335ac55a2298ecdb494 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Thu, 11 Sep 2025 17:12:30 +0100 Subject: [PATCH] fix(editor): prevent panic if permissions hasn't been assigned --- internal/tui/components/chat/editor/editor.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 4778c359ba4cad639b55671a252c4fde98eeab73..9608d6cee48502ccf491618a0bd19cdfeed57f5f 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -365,9 +365,11 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } func (m *editorCmp) setEditorPrompt() { - if m.app.Permissions.SkipRequests() { - m.textarea.SetPromptFunc(4, yoloPromptFunc) - return + if perm := m.app.Permissions; perm != nil { + if perm.SkipRequests() { + m.textarea.SetPromptFunc(4, yoloPromptFunc) + return + } } m.textarea.SetPromptFunc(4, normalPromptFunc) }