Fix crash after creating zero-length cursor line