diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-08-30 19:48:24 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-30 19:48:24 +0100 |
commit | 04c4c5746e15884768d2cb41370c3276a196cd4c (patch) | |
tree | 1e629820796635bd332b2066c03d548fad527f89 /src/time.c | |
parent | f240395fca63d4b330112a4b81e94b05b50de1aa (diff) |
patch 9.0.0335: checks for Dictionary argument often give a vague errorv9.0.0335
Problem: Checks for Dictionary argument often give a vague error message.
Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
Diffstat (limited to 'src/time.c')
-rw-r--r-- | src/time.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/time.c b/src/time.c index c28e7a97b7..d97c56e6c8 100644 --- a/src/time.c +++ b/src/time.c @@ -872,12 +872,10 @@ f_timer_start(typval_T *argvars, typval_T *rettv) msec = (long)tv_get_number(&argvars[0]); if (argvars[2].v_type != VAR_UNKNOWN) { - if (argvars[2].v_type != VAR_DICT - || (dict = argvars[2].vval.v_dict) == NULL) - { - semsg(_(e_invalid_argument_str), tv_get_string(&argvars[2])); + if (check_for_nonnull_dict_arg(argvars, 2) == FAIL) return; - } + + dict = argvars[2].vval.v_dict; if (dict_has_key(dict, "repeat")) repeat = dict_get_number(dict, "repeat"); } |