fix(examples): resolve nil pointer dereference (#1663)

This commit is contained in:
Matthew Caswell 2026-04-06 17:37:58 -04:00 committed by GitHub
parent ba7c9b8ff5
commit ee06e98c41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,10 +92,12 @@ func (m model) View() tea.View {
if !m.textarea.VirtualCursor() {
c = m.textarea.Cursor()
// Set the y offset of the cursor based on the position of the textarea
// in the application.
offset := lipgloss.Height(m.headerView())
c.Y += offset
if c != nil {
// Set the y offset of the cursor based on the position of the textarea
// in the application.
offset := lipgloss.Height(m.headerView())
c.Y += offset
}
}
f := strings.Join([]string{