commit 52b1043cbe49b88c7dc8b0baa3bb374206a59dd1 from: Omar Polo date: Mon Jul 19 10:19:21 2021 UTC missing NULL check commit - a87cfde96c9247f99db3ea7310131bdefeda3540 commit + 52b1043cbe49b88c7dc8b0baa3bb374206a59dd1 blob - 5e7bcfe55b4d8f4f5f6a596ce59f9302ed08dd2a blob + f5b1c014d6ab8dd8160a9bbc8a28d03b0a1d01da --- cmd.c +++ cmd.c @@ -222,6 +222,9 @@ cmd_end_of_buffer(struct buffer *buffer) { buffer->current_line = TAILQ_LAST(&buffer->head, vhead); + if (buffer->current_line == NULL) + return; + /* deal with invisible lines */ if (buffer->current_line->parent->flags & L_HIDDEN) forward_line(buffer, -1);