commit - c0be89335b195b639d4dd9a3159ddf6f38937444
commit + 2510002603337f808dc9857a6904a9ca3a6e9f22
blob - 823c8fb64d78f35ca68769e8728810744109a31c
blob + 036e9c76852c9117dd895e8f857f29baf3d12f38
--- tog/tog.c
+++ tog/tog.c
* We might necessarily overshoot in horizontal
* splits; if so, select the last displayed commit.
*/
- s->selected = MIN(s->selected,
- s->last_displayed_entry->idx - s->first_displayed_entry->idx);
+ if (s->first_displayed_entry && s->last_displayed_entry) {
+ s->selected = MIN(s->selected,
+ s->last_displayed_entry->idx -
+ s->first_displayed_entry->idx);
+ }
select_commit(s);
const struct got_error *err = NULL;
struct tog_log_view_state *s = &view->state.log;
int g, idx = s->selected_entry->idx;
+
+ if (s->first_displayed_entry == NULL || s->last_displayed_entry == NULL)
+ return NULL;
g = view->gline;
view->gline = 0;