fix(api): error properly with invalid field in nvim_open_win (#30078)

This commit is contained in:
zeertzjq
2024-08-18 07:10:27 +08:00
committed by GitHub
parent b0a042e877
commit cce1eb0806
2 changed files with 39 additions and 9 deletions

View File

@@ -1038,7 +1038,7 @@ static void parse_border_style(Object style, WinConfig *fconfig, Error *err)
static void generate_api_error(win_T *wp, const char *attribute, Error *err)
{
if (wp->w_floating) {
if (wp != NULL && wp->w_floating) {
api_set_error(err, kErrorTypeValidation,
"Missing 'relative' field when reconfiguring floating window %d",
wp->handle);