From 4cb5ce3c529b1e03b6c9f2733eec88a48173818f Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Tue, 17 Jun 2014 12:21:53 -0300 Subject: 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. --- src/nvim/os/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit