clang/'Logic error': assert get_decor_provider(id, true) returns nonnull

nvim_set_decoration_provider() has undefined behavior (if not crash)
if get_decor_provider() returns NULL.
This commit is contained in:
Jan Edmund Lazo 2021-06-02 21:49:35 -04:00
parent 68cb51ab0a
commit 6a2f1b1740
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -2954,6 +2954,7 @@ void nvim_set_decoration_provider(Integer ns_id, DictionaryOf(LuaRef) opts,
FUNC_API_SINCE(7) FUNC_API_LUA_ONLY
{
DecorProvider *p = get_decor_provider((NS)ns_id, true);
assert(p != NULL);
decor_provider_clear(p);
// regardless of what happens, it seems good idea to redraw