aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-06-17 12:21:53 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-06-18 11:36:07 -0300
commit4cb5ce3c529b1e03b6c9f2733eec88a48173818f (patch)
tree60d78232a3f9ee5e938321fe5322894bad9957c4 /src
parentabc423983d85d5110fae21e661d36075379ce9c3 (diff)
downloadrneovim-4cb5ce3c529b1e03b6c9f2733eec88a48173818f.tar.gz
rneovim-4cb5ce3c529b1e03b6c9f2733eec88a48173818f.tar.bz2
rneovim-4cb5ce3c529b1e03b6c9f2733eec88a48173818f.zip
channel: Make channel_{un}subscribe abort the program for invalid ids
These functions will never be called directly by the user so bugs are the only reason for passing invalid channel ids. Instead of returning silently we abort to improve bug detection.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/channel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/os/channel.c b/src/nvim/os/channel.c
index 89e7f9d9de..dc8f26026e 100644
--- a/src/nvim/os/channel.c
+++ b/src/nvim/os/channel.c
@@ -141,7 +141,7 @@ void channel_subscribe(uint64_t id, char *event)
Channel *channel;
if (!(channel = pmap_get(uint64_t)(channels, id))) {
- return;
+ abort();
}
char *event_string = pmap_get(cstr_t)(event_strings, event);
@@ -163,7 +163,7 @@ void channel_unsubscribe(uint64_t id, char *event)
Channel *channel;
if (!(channel = pmap_get(uint64_t)(channels, id))) {
- return;
+ abort();
}
unsubscribe(channel, event);