summaryrefslogtreecommitdiffstats
path: root/src/typval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index af96b3170b..62958f6302 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -623,6 +623,16 @@ check_for_opt_dict_arg(typval_T *args, int idx)
|| check_for_dict_arg(args, idx) != FAIL) ? OK : FAIL;
}
+/*
+ * Check for an optional non-NULL dict argument at 'idx'
+ */
+ int
+check_for_opt_nonnull_dict_arg(typval_T *args, int idx)
+{
+ return (args[idx].v_type == VAR_UNKNOWN
+ || check_for_nonnull_dict_arg(args, idx) != FAIL) ? OK : FAIL;
+}
+
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
/*
* Give an error and return FAIL unless "args[idx]" is a channel or a job.