From 57837bbf67c10638e0684c93bb29e88ca9b07b52 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 11 Aug 2023 17:09:00 +0000 Subject: [PATCH] Do not crash if in buffer mode and the last buffer is deleted using the command. --- mode-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode-tree.c b/mode-tree.c index 5a213df4..fa251c8d 100644 --- a/mode-tree.c +++ b/mode-tree.c @@ -497,7 +497,7 @@ mode_tree_build(struct mode_tree_data *mtd) mode_tree_clear_lines(mtd); mode_tree_build_lines(mtd, &mtd->children, 0); - if (tag == UINT64_MAX) + if (mtd->line_list != NULL && tag == UINT64_MAX) tag = mtd->line_list[mtd->current].item->tag; mode_tree_set_current(mtd, tag);