aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/channel.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-11-11 10:57:16 +0100
committerGitHub <noreply@github.com>2021-11-11 10:57:16 +0100
commit5d653a134464fe06c488dd67071359b04e90949e (patch)
tree0ea641168deeac2a84f424a0fafcd5cb0ad90673 /src/nvim/channel.c
parent0ecc58c2775ae576a3325aec163aa1018aad9e0a (diff)
parent8b5c32c8cd9b76aaefa0977a69789fa9bd43f2fd (diff)
downloadrneovim-5d653a134464fe06c488dd67071359b04e90949e.tar.gz
rneovim-5d653a134464fe06c488dd67071359b04e90949e.tar.bz2
rneovim-5d653a134464fe06c488dd67071359b04e90949e.zip
Merge pull request #16276 from zeertzjq/channel-closed-term-error
Fixes and tests for sending to terminal channel whose terminal has been deleted
Diffstat (limited to 'src/nvim/channel.c')
-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;