on main help sign in
fix: panic when matching titles in session dialogue
7ace8d5Christian Rocha
internal/ui/dialog/sessions_item.go+1−1
@@ -141,7 +141,7 @@ func renderItem(t ListIemStyles, title string, info string, focused bool, width
141 titleWidth := lipgloss.Width(title)
141 titleWidth := lipgloss.Width(title)
142 gap := strings.Repeat(" ", max(0, lineWidth-titleWidth-infoWidth))
142 gap := strings.Repeat(" ", max(0, lineWidth-titleWidth-infoWidth))
143 content := title
143 content := title
144− if matches := len(m.MatchedIndexes); matches > 0 {
144+ if m != nil && len(m.MatchedIndexes) > 0 {
145 var lastPos int
145 var lastPos int
146 parts := make([]string, 0)
146 parts := make([]string, 0)
147 ranges := matchedRanges(m.MatchedIndexes)
147 ranges := matchedRanges(m.MatchedIndexes)