mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user