From: nicm Date: Thu, 10 Jun 2021 07:53:19 +0000 (+0000) Subject: Do not use NULL client when source-file finishes, GitHub issue 2707. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f7302605917e4df3116e854017023298620dc295;p=openbsd Do not use NULL client when source-file finishes, GitHub issue 2707. --- diff --git a/usr.bin/tmux/cmd-source-file.c b/usr.bin/tmux/cmd-source-file.c index ab3a5002722..f7478bff099 100644 --- a/usr.bin/tmux/cmd-source-file.c +++ b/usr.bin/tmux/cmd-source-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-source-file.c,v 1.48 2020/09/01 09:19:01 nicm Exp $ */ +/* $OpenBSD: cmd-source-file.c,v 1.49 2021/06/10 07:53:19 nicm Exp $ */ /* * Copyright (c) 2008 Tiago Cunha @@ -68,7 +68,9 @@ cmd_source_file_complete(struct client *c, struct cmd_source_file_data *cdata) struct cmdq_item *new_item; if (cfg_finished) { - if (cdata->retval == CMD_RETURN_ERROR && c->session == NULL) + if (cdata->retval == CMD_RETURN_ERROR && + c != NULL && + c->session == NULL) c->retval = 1; new_item = cmdq_get_callback(cmd_source_file_complete_cb, NULL); cmdq_insert_after(cdata->after, new_item);