diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-22 19:35:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 19:35:02 +0800 |
commit | 783b0aba411618c27cae48625f0f98e0cb503758 (patch) | |
tree | bc7cadc915244ab0c41d07f9c0e01f03f9f14563 /src | |
parent | f2db5521eb545e451f261470c6bfc31dfac11887 (diff) | |
download | rneovim-783b0aba411618c27cae48625f0f98e0cb503758.tar.gz rneovim-783b0aba411618c27cae48625f0f98e0cb503758.tar.bz2 rneovim-783b0aba411618c27cae48625f0f98e0cb503758.zip |
fix(completion): check that healthcheck name is string (#28458)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/cmdexpand.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index c1d219c32f..49944aa895 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -2598,7 +2598,8 @@ static char *get_healthcheck_names(expand_T *xp FUNC_ATTR_UNUSED, int idx) last_gen = get_cmdline_last_prompt_id(); } - if (names.type == kObjectTypeArray && idx < (int)names.data.array.size) { + if (names.type == kObjectTypeArray && idx < (int)names.data.array.size + && names.data.array.items[idx].type == kObjectTypeString) { return names.data.array.items[idx].data.string.data; } return NULL; |