patch 9.0.0335: checks for Dictionary argument often give a vague error
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
diff --git a/src/popupwin.c b/src/popupwin.c
index 7459b98..2f9df8d 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2016,11 +2016,8 @@
emsg(_(e_buffer_number_text_or_list_required));
return NULL;
}
- if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
- {
- emsg(_(e_dictionary_required));
+ if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return NULL;
- }
d = argvars[1].vval.v_dict;
}
@@ -2928,11 +2925,8 @@
if (wp == NULL)
return; // invalid {id}
- if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
- {
- emsg(_(e_dictionary_required));
+ if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return;
- }
dict = argvars[1].vval.v_dict;
apply_move_options(wp, dict);
@@ -2963,11 +2957,8 @@
if (wp == NULL)
return; // invalid {id}
- if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
- {
- emsg(_(e_dictionary_required));
+ if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return;
- }
dict = argvars[1].vval.v_dict;
old_firstline = wp->w_firstline;