fix(examples): resolve nil pointer dereference (#1663)
This commit is contained in:
parent
ba7c9b8ff5
commit
ee06e98c41
1 changed files with 6 additions and 4 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Reference in a new issue