fix(completion): check that healthcheck name is string (#28458)

This commit is contained in:
zeertzjq
2024-04-22 19:35:02 +08:00
committed by GitHub
parent f2db5521eb
commit 783b0aba41
2 changed files with 16 additions and 1 deletions

View File

@@ -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;