fix(editor): prevent panic if permissions hasn't been assigned

tauraamui created

Change summary

internal/tui/components/chat/editor/editor.go | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Detailed changes

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)
 }