diff options
-rw-r--r-- | libcaja-private/caja-undostack-manager.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcaja-private/caja-undostack-manager.c b/libcaja-private/caja-undostack-manager.c index f53d4466..ccb1c0f0 100644 --- a/libcaja-private/caja-undostack-manager.c +++ b/libcaja-private/caja-undostack-manager.c @@ -1089,8 +1089,8 @@ stack_clear_n_oldest (GQueue * stack, guint n) guint i; for (i = 0; i < n; i++) { - action = (CajaUndoStackActionData *) - g_queue_pop_tail (stack); + if ((action = (CajaUndoStackActionData *) g_queue_pop_tail (stack)) == NULL) + break; if (action->locked) { action->freed = TRUE; } else { |