aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/channel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index 0eae87c1f8..9662f6205f 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -535,7 +535,11 @@ size_t channel_send(uint64_t id, char *data, size_t len, bool data_owned, const
goto retfree;
}
- if (chan->streamtype == kChannelStreamInternal && chan->term) {
+ if (chan->streamtype == kChannelStreamInternal) {
+ if (!chan->term) {
+ *error = _("Can't send data to closed stream");
+ goto retfree;
+ }
terminal_receive(chan->term, data, len);
written = len;
goto retfree;