From: nicm Date: Fri, 11 Aug 2023 17:09:00 +0000 (+0000) Subject: Do not crash if in buffer mode and the last buffer is deleted using the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3ece9b2c717a9e2505096cd14b906bad3511b088;p=openbsd Do not crash if in buffer mode and the last buffer is deleted using the command. --- diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c index 08a5c294f5f..7951cc8d0df 100644 --- a/usr.bin/tmux/mode-tree.c +++ b/usr.bin/tmux/mode-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mode-tree.c,v 1.64 2023/08/08 08:08:47 nicm Exp $ */ +/* $OpenBSD: mode-tree.c,v 1.65 2023/08/11 17:09:00 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott @@ -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);