diff --git a/src/text.c b/src/text.c index e704a36c..c207b467 100644 --- a/src/text.c +++ b/src/text.c @@ -629,7 +629,7 @@ void do_redo(void) undo *u = openfile->undotop; /* Get the previous undo item. */ - while (u->next != openfile->current_undo && u != NULL) + while (u != NULL && u->next != openfile->current_undo) u = u->next; if (u == NULL) {